Web design, programming, graphics, and pretty much anything else I care about.

Discover CCK field table and column information

When retrieving information from the database for CCK fields, you can't assume the schema. Fields may be added to the content table, but if they are included on more than one content type, they get moved to their own table. Because things might move around, you can't make assumptions about where they will be. CCK api has functions you can use to determine where things are located.

Creating date repeat rules

Because Date doesn't play well with drupal_execute(), you have to use node_save() to insert/update nodes. If those nodes have a date field that uses repeats, you have to manually create the date array and repeat rule. ugh!

Programmatically inserting nodes

Inserting nodes, programmatically, is not always the easiest thing. The "drupally" way of doing it is to build the node form array and then submit it to drupal_execute(). (http://api.drupal.org/api/drupal/includes--form.inc/function/drupal_exec...) This follows the same procedure that the node/add form follows. This method will make sure that all the same validations occur, permission checks, etc. The problem is this is a slow process, and some modules don't work well with drupal_execute; namely, Date. To insert modules that have date fields, use node_save().

Install taxonomy, with terms and hierarchy, on module installation

Getting a module to install a vocabulary, and even import terms, is not terribly difficult; however, getting it to accept an existing hierarchy can be tricky.

(I was working with a taxonomy for academic departments and schools.)

Create an include file. I name them module name.taxonomy.def.inc. In the file create an array that will define the vocabulary, and one that will include the terms.

Configure CCK fields on module installation

You can have a module installation automatically add and configure CCK field. First, setup the CCK fields on a development site exactly as you want them. Then, export the fields from /admin/content/types/export.

You will end up with the code for a php array that looks something like ...

Update email send time always incremented by one cron run

I enabled the update feature that emails me whenever the site has an update available. I noticed that the time the email gets sent is always incremented by one cron run. For example, I have cron running hourly, so if there are updates needed it will email me at 8am, the next day at 9am, the next day at 10am, etc. But, based on the math, whatever interval cron runs at the email will likely always be one run later.

In hook_cron, the if statement requires the current time to be greater than interval (in my case, 24hrs). If it is exactly 24hrs, it will not pass.

Drupal update status email

I hate when I configure a site to notify me of available updates and all I get is this generic email.

There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.

There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.

As and admin, I would like something more specific than this. It is like an error message that says "ERROR".

Drupal.org handbook content audit

lisarex has started a content audit for drupal.org. The plan is to start with handbook pages, like the Theming Guide. http://groups.drupal.org/node/139814 . There are some 1200 pages to audit. That's just the handbooks! I've been helping by assisting Lisa with the development server. Getting various views setup to organize what needs auditing, and also setting up flags. (and fixing the broken site) I've also already audited several sections. Please lend a hand, if you have time to spare! you can contact me directly, or lisarex.

DOPL

My friend Brian took over maintenance of the DOPL module. http://drupal.org/project/dopl We are experimenting with using it for the support.drupal.org project. It is great for linking directly to drupal.or nodes. See more here - http://drupal.org/node/1122198

Drupal docs admin

I'm now a drupal.org documentation admin. http://drupal.org/node/1114036 . What shall I destroy first! But, seriously, the drupal.org Documentation Team could use a lot of help. If you are interested, sign up. http://drupal.org/contribute/documentation