Science Collaboration Framework
complex view example
<?php
$view = new view;
$view->name = 'contributions';
$view->description = 'Articles and Commentary';
$view->tag = 'content type';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
E-mails being sent or nodes being saved by batch api breaking on a regular schedule just during cron runs
If you are having weird problems in Batch API processes, such as the base URL for notification e-mails being replaced with something less-than-useful like /var/www/drupal, the culprit may be (somehow) cron.php being called by a command line script (rather than curl or something going to cron.php over the internet).
"Content profile registration broken": debugging rogue form validate overrides
Bad coding in a development partner's custom module was the culprit. It was overriding content_profile_registration's setting of a validation function (and every other module's, too).
Inside the custom module's implementation of hook_form_alter() lives the error:
<?php
switch ($form_id) {
// ... ignore lots of code
case 'user_register':
// ... ignore more code
Check if a field exists
http://api.drupal.org/api/function/field_info_field/7
field_info_field('field_name') returns an object or NULL.
Drupal 7 module development gotchas
First we discovered that you need a .module file for your module to be recognized. A .info file is not enough. (In this case, we only wanted the .install file, we made an empty .module file, and all was well. But then we wanted to add some functions to that empty .module file...)
Now we have found that you need to declare
files[] = agaric_example.moduleMaking changes to a nested array that may have arrays or strings in some values
Pulled this from the test module for the new RDF module we're putting in Drupal core.
// dealing with a nested array where the top level can be a string or an
// array is complex and helper functions may be a good addition
<?php
rdf_mapping_alter_create('rdf_test_container', 'title', )
/**
* Make adding an attribute and property sane. $prop can be an array.
*/
Change the location of an SVN repository for the working copy
Change repository
svn switch --relocate http://old.example.com/svn/pdonline http://svn.new.example.com/svn/pdonline
