User login

Drupal Development

Set higher minimum server environment requirements for a Drupal installation profile

There's a hook for that! The logically named hook_requirements lets you set requirements for each module.

To make these requirements apply to an installation profile, simply put your implementation of hook_requirements in the .install file of a module that is required by that installation profile.

Skip down to the resolution for the code that worked– doing it this Drupal way.

Keep reading for the various wrong turns on the path to the right direction.

Provide an 'Add New' link on a simple view for easily creating more content to list

It's a common situation– you create a simple view that may do little more than filter on one content type in order to get a listing of press releases or links or recipes.

Sure, you can explain to your client and users that going to "Create content" and clicking press release or link or recipe will, when the post is submitted, get it automatically listed on this Views page. And that's pretty nice. But it's a lot more intuitive if the link to create relevant content were right on the view itself.

Testing patches for Drupal from a Windows machine

There are various approaches to getting a usable development environment working on a Microsoft Windows machine. Here are some:

VirtualBox

Best bet, virtualbox? Let's you make believe you're actually on, say Debian Linux.

http://www.virtualbox.org/wiki/Downloads

Looking at SQL to fix broken queries in a Drupal environment

Alternate title: Apparently I don't understand SQL (and so need all the help I can get)

The easiest way to get a better look at your SQL in Drupal is to install the devel module. (Hint: It's for use on development sites, not production sites!)

Update Drupal core for fresh testing

cvs up -dP

If you want to completely wipe the slate clean, you can also do:

cvs up -dPC

Be careful with the C. That will overwrite anything in core you are working on.

Resolution

Explode takes a parameter to stop exploding after a set number of splits

Explode has a limit parameter. Happy day at Agaric!

This code below was written offline when I was merely hoping that explode could be limited to splitting on its first parameter only the first time said parameter is seen:

Relationship processing code from SCF custom Ontology module

<?php
    db_query('delete from {ontology_relationships}');
   
    $bio_process_vocab = taxonomy_extra_get_vocab(6);
    $cell_components_vocab = taxonomy_extra_get_vocab(7);
    $molec_functions_vocab = taxonomy_extra_get_vocab(8);
   
    $term_glossary = array(); // format: term name => taxonomy ID
    $term_index = array(); // format: GO ID term => taxonomy ID

Remove "Add comment" links from teasers

See and report to:

How to disable "Add new comment" at teaser part, but "Read more" remains
http://drupal.org/node/151648

Hi Brian,

So the Drupal user interface wasn't enough? You had to make a custom node template? It took us a few months to notice the new options for displaying fields, but now we use it a lot instead of node-TYPE.tpl.php files. And I'd be interested what in that post needed updating for Drupal 6!

Snips of TCS import function for Taxonomy XML for future reference

<?php
// commented out below from TCS, possibly of interest
  //  $term = (object) array(
  //    'predicates' => array(),
  //  );
   
//    $term->id = $concept->getAttribute('id');

//    $term->uri = $url;

//      $term->name = $termname->textContent;
//      $term->namerefs[] = $termname->getAttribute('ref');

Syndicate content