December 2008

Building out Drupal module interfaces with a stub function

A technique that I’m finding quite useful during module development is to create a “stub” function for use as a generic interface callback for menu items that I want to define, but haven’t yet written callbacks for. For example, if I were building a Drupal 5 module called widgetmaster, I would define:

read more

Searching the Drupal Database by Regular Expression

I found myself wanting to use regular expressions to find some imported Drupal nodes containing broken old image paths. Naturally, I went looking for a module that might accommodate me and I did find the Scanner module. Unfortunately the site I was working with is in Drupal 6, and I didn’t have the time to work on a Drupal 6 port of what looks like a pretty sophisticated module just to find a few nodes.

read more

GMail Aliases for Testing Multiple Drupal User Registrations

One of GMail’s handier features that people are still surprised to learn about is the ability to make multiple, unique address aliases on the fly.

If your GMail address is example@gmail.com, emails sent to example+user1@gmail.com, example+user2.gmail.com, example+admin@gmail.com will all go to the root example@gmail.com address.

read more

Modifying CCK fieldgroups with hook_form_alter()

I was writing a module to conditionally hide a fieldset on a CCK node editing form based on whether the user is logged in or not, and for a while I was very puzzled as to why my custom module’s implementation of hook_form_alter wasn’t seeing any of the fieldsets defined by the CCK fieldgroup module.

I searched Google for the terms ‘cck fieldset hook_form_alter’, which led me to a helpful tip from Benjamin Melançon:

read more

Syndicate content

Twitter

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key