Pro Drupal Development, Second Edition arrives

The author's copies of Pro Drupal Development, Second Edition arrived today. At 667 pages, the book is significantly thicker than the first edition!

I worked on this edition from November of 2007 to July 2008 pretty much without stopping. One morning my daughter found me in the living room writing a chapter at 3 am. It is difficult to express how much work this book has been, and how happy I am to hold the printed copy in my hands. Those who have written books will understand. :) I am glad to finally have it get into the hands of Drupal developers everywhere, and I hope that this contribution helps to complete the transition from Drupal 5 to Drupal 6. Thanks so much to all who have helped with this project!

Profits from the book go to this little guy's college fund. (And if you buy it through drupalbook.com, the Drupal Association gets a percentage of each sale.)

[ Submitted by John on Mon, 2008-08-18 11:26. | | ]

Joining Lullabot

The rumors are true! As of today, I'm officially a Lullabot. People have been asking me, why leave the safety of a solid academic position to join a small company? I think the better question is, what kind of a company must Lullabot be for someone in a solid academic position to leave academia in order to join it? For those just stirring from in front of their VAX terminals (and why should they? the system is still up!), Lullabot is an open source education and consulting firm, focusing on the increasingly popular content management framework Drupal.

I look forward to being more involved in the open source community. And yes, the book is almost done!

[ Submitted by John on Tue, 2008-07-01 09:22. | | ]

Second edition progress

I thought I'd update everyone on the progress of the second edition of Pro Drupal Development.

The second edition will cover Drupal 6, and is expanded to cover new core topics like actions, triggers, AHAH, etc.

[ Submitted by John on Sun, 2008-04-27 21:44. | | ]

Workflow 5.x-2.0 released

I've finally got a project that uses the workflow module so I've been able to justify putting some time into it. As a result, I've released version 5.x-2.0. This version of workflow works with the 5.x-2.x version of actions, which is the backport of Drupal-6-style actions to Drupal 5.

[ Submitted by John on Sun, 2008-04-20 15:00. | | ]

Growth of Drupal

Others are posting on Drupal's growth today. A picture is worth a thousand words, so here are 2000 words on the subject:

Antwerp, 2005

Boston, 2008

[ Submitted by John on Fri, 2008-03-14 09:05. | | ]

Letter to Dries, July 2004

At Drupalcon 2008, one question I was asked a number of times was "how did you get involved with Drupal?" Here's one of my first letters to Dries, after discovering Drupal in 2004. Interesting to think about how far we've come since then.

Hi Dries,

[ Submitted by John on Mon, 2008-03-10 11:08. | | ]

Slides from Drupalcon Boston 2008

Video of the presentation I gave at Drupalcon Boston 2008, titled Triggers and Actions and Hooks, Oh, My! should be appearing shortly. (In the meantime, here's me babbling about actions.) The slides are downloadable below.

[ Submitted by John on Mon, 2008-03-10 07:41. | | ]

Drupalcon 2008 actions session

The session I proposed, Triggers and Actions and Hooks, Oh My! has been accepted at Drupalcon Boston 2008. I will be presenting the new capabilities of Drupal 6 in this area, from the big ideas to the nitty gritty. The session will be Tuesday afternoon from 5-6 pm, just before the Acquia Conference Social.

We had 26 people at the first Drupal conference in Antwerp (three years ago today, by the way!). There are currently 800 registered attendees for the upcoming Drupalcon, and the conference has reached its maximum capacity.

I'm looking forward to the presentations, the birds-of-a-feather meetings, hanging out with a bunch of geeks, some hacking time, and the business fair.

[ Submitted by John on Mon, 2008-02-25 17:29. | | ]

How to Speed up Drupal Forum Pages on a Busy Site

Drupal 5's forum module is OK. It lets you create multiple forums with taxonomy terms. Forum posts are true nodes so you get all the benefits of nodeness. And Drupal keeps track of which posts you've read. All that is great. But I've had some trouble scaling up a site that relies heavily on the forum module, even when using advcache. Investigating how the database was spending its time, I found lots of queries like this:

SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM node n INNER JOIN node_comment_statistics l ON n.nid = l.nid INNER JOIN term_node r ON n.nid = r.nid AND r.tid = 123 WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, l.last_comment_timestamp desc

An EXPLAIN shows how nasty this is:

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE n ref PRIMARY,node_type,status,node_status_type,nid node_status_type 102 const,const 30679 Using where; Using temporary; Using filesort
1 SIMPLE l eq_ref PRIMARY PRIMARY 4 drupal.n.nid 1  
1 SIMPLE r eq_ref PRIMARY,nid,tid PRIMARY 8 const,drupal.l.nid 1 Using where; Using index

Searching Drupal's code turns up this query in theme_forum_topic_navigation(). It turns out the database is smoking, grinding away, eating up cycles generating previous and next links for forum topics. I thought about it for a minute, and realized that I don't think I've ever used those links. Which would you rather have? Blazing speed or a link to the next forum topic? Fortunately, the slow query is in a themable function, which means we can get our performance back with a few lines added to our theme's template.php:

// No previous/next links for forum topics.
phptemplate_forum_topic_navigation($node) {
  return '';
}

In my case, server load dropped from 46 to 0.5. Sometimes it's the little things.

[ Submitted by John on Tue, 2008-02-05 20:51. | | ]

Multistep Forms with Lookup Functions that Change Values

A number of people lately have been asking about how to change the values of form fields in multistep forms. So I wrote up an example.

Here we have a simple multistep form that lets you enter the name of a U.S. state, such as Iowa. Note the form has a default value.

Then, upon clicking the Lookup button, the value "Iowa" is replaced with a standardized state abbreviation, IA.

Upon submission both values are available to the submit function.

This example is not intended to do anything useful. It's just a little example that you can poke around with to learn how the sometimes confusing multistep form submission works in Drupal 5. You can download the module here.

[ Submitted by John on Tue, 2008-01-29 14:40. | | ]