jvandyk's blog

Interview

I was interviewed by OStatic about the book and Drupal 6 in general.

Finished

All materials have been submitted and the book went to "manufacturing" today. I've also updated this website so that errata for the second edition can be submitted. I will update the Contents and Sample pages when the new versions become available.

Page proofs

The review of page proofs, which constitutes the last stage of production, has begun!

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.

I am currently ahead of my writing schedule. It looks like I will be able to work on the book intensively in May when I will be taking some vacation from my day job. This means that I will have the final chapter in about four weeks from today.

Drupalcon 2008 Boston

It was a pleasure to attend the 2008 Boston Drupalcon and meet some of the many Drupal developers who have read Pro Drupal Development. One of the goals of the book was to bring smart people into the Drupal community -- people who don't have to be told how to set up PHP, or what CSS is. What they need is a technically detailed and accurate description of how Drupal works. This allows them to get up to speed quickly and minimize the time it takes to become productive with Drupal. From the conversations I had in Boston, it appears to have worked, and that is gratifying.

The second edition is coming along nicely.

Conspiracy theories

It's interesting to watch the conspiracy theories over at Amazon.com. Perhaps the publisher and the author are sneakily in cahoots to sell books about Drupal 5 to unsuspecting Drupal 6 users! As is often the case, the truth is much less interesting. In the flurry of chapter revisions, final proofs and corrections, the detail of putting "Covers Drupal 5" on the cover was simply overlooked. I'm willing to bet the second edition will say "Covers Drupal 6" on the cover.

Second edition?

The rumors are true. A second edition of Pro Drupal Development is under construction, targeted for early summer. The second edition will cover Drupal 6.

[Update: the second edition is now available.]

Getting annotation module menu entries to show up

There seems to be some confusion about the annotation module example in Chapter 2 of the first edition of the book. I have had some angry emails from people who are frustrated. I apologize for not taking an even more step-by-step approach.

Perhaps the first mistake was on the top of page 13, where I wrote

Save your file and visit Administer - Site building - Modules. Your module should how up in the list. How exciting!

I meant to have the reader experience a sense of accomplishment here. Unfortunately, I think a lot of readers went ahead and enabled the annotation module at this point instead of just thinking "Cool! It's in the list of modules!" Wrong! If you enable the module before implementing the menu hook (which we do on the rest of page 13) Drupal will look for the menu hook, not find it, and cache the result internally. Then when readers typed in the menu hook and the settings hook on pages 13 and 14, they got frustrated because when they went to Administer - Site configuration there was no entry for the annotation module. That's because Drupal is using the menus it cached earlier. It didn't help that Drupal changed the title of the page from Settings to Site configuration (the book refers to Administer - Settings - Annotate when it should be Administer - Site configuration - Annotation settings. The URL path remains the same: http://example.com/?q=admin/settings/annotate.

So, if you are going through chapter 2, do not enable the annotation module until after you have added the annotate_menu() function and the annotate_admin_settings() functions to your module and saved the annotate.module file. That way, when you enable the module, Drupal will find the menu hook and add the Administer - Site configuration - Annotation settings entry.

I would insert a note to enable the module in the paragraph just before Figure 2.1.

Again, apologies to those who have been frustrated by this. Don't give up!

Reprinting

The book has been reprinted several times. At each reprinting, the submitted errata were incorporated. So if you have recently gotten a copy of the book, the older errata on this site may not apply.

Trailing commas

Recently Matthew Pare submitted an entry to Errata suggesting that the lack of a trailing comma in array definitions throughout the book is an error because the Drupal coding standards call for it.

I deleted that submission and thought I'd give an explanation. First, that convention is not used throughout core. Second, I consider adding a comma to the end of your array definition, e.g.

$foo = array(
'bar' => 1,
'baz' => 2,
);

just in case you might add an element later to be a bit like this code:

$zonk = '';
; // we might add something later here so we need a semicolon

However, I have heard something about some IDE not indenting correctly if the comma is not there. I'm light on details. But if that is the case, it sounds to me like a bug in the IDE.

In summary, I consider the practice of putting a trailing comma after the terminal array element to be something that's fine practice but not necessary.

Update: chx informs me that the comma was originally added to the coding standards because (1) var_export() adds it; (2) it makes moving an element of an array up or down in the array easier, and (3) it makes adding a new element to an array easier.