What Pro Drupal Development is, and What it Is Not
As copies of Pro Drupal Development, Second Edition hit the streets, I'd like to take a moment to clarify what the book is and what it is not.
What it is not
- A complete and comprehensive guide to using MySQL with Drupal
- A detailed howto on integrating Drupal with Sphinx
- The ultimate reference on using jQuery/AJAX/JavaScript with Drupal
- A step-by-step tutorial on building an ecommerce site with Drupal
- ...
What it is
The target audience of Pro Drupal Development is smart people who know PHP (or other languages; PHP can be picked up pretty easily) and are looking for an overview of how Drupal core works. It achieves this by walking through Drupal's major systems: users, nodes, filters, triggers, themes, etc. One of the challenges in writing the book was knowing when to stop. Take theming, for example. To do justice to Drupal's theming system would take a 400-page book in itself. The same goes for working with multimedia files, or optimization, or jQuery. The idea of Pro Drupal Development is to lay down the basics in each of these areas so that the reader is oriented and can then go on to use other resources, or to just better understand the code itself. Other books are being written that will provide great detail in specific areas, and I'm glad to see that -- it's a sign that Drupal is maturing and becoming well-known enough that there is a demand.
Pro Drupal Development was written to provide an on-ramp for intelligent people starting with Drupal so they can avoid months of feeling dumb in irc or having to piece together the big picture from a blog post here, a doc page there, a README here (that's the way I learned Drupal, and it's a frustrating way to learn). If the book fulfills this goal (and from my conversations with new developers it has) then I am satisfied.
When you find errors in the book, please post them as errata so that others can benefit. I'd recommend that when you get the book, go through the errata and make notes in the margins so that when you use the book for reference, you'll see the corrections. With the first edition, we were able to correct a lot of the errors in the second and third printings.
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.)
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!
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.
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.
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:
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,
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.
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.
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.
function phptemplate_forum_topic_navigation($node) {
return '';
}In my case, server load dropped from 46 to 0.5. Sometimes it's the little things.



