moduledevelopment

Getting an error inside a core function? Infinite Redirect? debug_backtrace() to the rescue!

Published April 20, 2011

We are all very familiar with the White Screen of Death in the Drupal world, AKA WSOD. One very common cause is a lack of memory for PHP - yet another is having errors turned off.

In development mode, you should probably make sure you are showing PHP errors on the screen, if this is an option. This is the kind of thing you can edit in your site-specific settings.php file, by using:

Taking over an un-maintained or abaondoned Project on Drupal.org

Published February 3, 2010

Ever downloaded a module and noticed several obvious bugs? Often, you can look in the issue queue for a module and find fixes, code patches, and help with these problems. For certain modules, the maintainer of the code may not respond - he or she may no longer be developing with Drupal, may have changed his or her email address, or any number of other factors.

Making Sure Your Redirects Work as Expected

Published August 16, 2009

Whenever you need to write a custom module that involves redirection using the drupal_goto() function, things can always get tricky - especially if there are other forces at work. One such force might be the "destination" variable that sometimes gets passed around in the URL querystring when the user is attempting to access content that requires authentication.

Module Development - Alternative to the "Are You Sure?" Screen

Published July 11, 2009

There have been several times where I've had to write a custom module that enables the site admin to make some major changes to their site. With changes like these, I want the site admin to be super-duper sure they know what they're doing, so while sometimes I use Drupal's built-in Confirm Form function, I sometimes decide to take a less-intrusive approach.

Module Development - Manually Creating Node Revisions

Published July 11, 2009

If you've ever done any Drupal module development, then you've probably run across the node_save() function. This little beauty is the equivalent of the "submit" button on a node form. If you know anything about module development, you know that any module can tap into the "node save" process via hook_nodeapi(). By manually creating a node in code an saving it to the database with node_save(), you allow all the other modules on your site the opportunity to add their magic to your new node.

A Better Drupal API Documentation Site

Published May 28, 2009

The brainiacs over at Lullabot recently unveiled api.lullabot.com, their version of Drupal.org's API documentation site. While on the outset, it seems similar, there are some nice features of the Lullabot site that make it very worthwhile to use.

First and foremost, in addition to documentation for Drupal core, they also added the documentation for a large number of popular Drupal modules, including Views, CCK, and Ubercart.