Errata (Second Edition)
This page lists the errors found in the book.
Chapter 2. Writing a Module, Page 30
Sat, 09/13/2008 - 9:46pm — mikewhobikesAfter creating new variables ('annotate_limit_per_node' and 'annotate_deletion') the .install file should be updated to delete those variables on uninstall.
Either instructions on what to add to annotate.install or just a brief note to remind the reader to do so would be helpful.
Chapter 2. Writing a Module, Page 34
Sun, 12/27/2009 - 9:22am — ckInclude "annotate.admin.inc" in listing of files in the annotate directory.
Chapter 3. Hooks, Actions, and Triggers, Page 36
Mon, 09/29/2008 - 7:33pm — ericxfunction hook_nodeapi(&$node, $op, $a3=NULL, $a4=NULL) {
function beep_nodeapi(&$node, $op, $a3=NULL, $a4=NULL) {
The function name should be "beep_nodeapi" rather than "hook_nodeapi". The hook itself is named hook_nodeapi(). The hooked version for the module needs to be name [module name]_nodeapi().
Chapter 3. Hooks, Actions, and Triggers, Page 41
Thu, 12/11/2008 - 11:17am — miluNot strictly an error, but definitely a gotcha for the unwary user. The book says: If you've done everything correctly, your action should be available in the user interface [...] Some users of Drupal 6.6 (and possibly other versions) may find this misleading and waste time looking for errors in their code, which may not be there or, at any rate, not have anything to do with the observed effect of the actions not becoming available.
State that you may have to click on admin/settings/actions in order for your changes to be reflected on the admin/build/trigger page.
I've left the path of strict and verbatim obedience to the book's prescription, and defined the actions in a module that had already been installed. The actions didn't show up in the user interface. In Drupal 6.6, which is what I'm using, you have to click on admin/settings/actions in order for the actions to be registered in the actions table, whence they are retrieved to be displayed in the dropdown menus on admin/build/trigger.
Chapter 3. Hooks, Actions, and Triggers, Page 41
Wed, 09/10/2008 - 7:59pm — mikewhobikesIf you've done everything correctly, your action should be available
If you've done everything correctly and enabled the Beep module, your action should be available
Minor suggestion: a reminder to enable the Beep module would be helpful.
Chapter 3. Hooks, Actions, and Triggers, Page 47
Sun, 02/01/2009 - 3:23pm — jimhollcraftfor ($i=1; $i < $context['beeps']; $i++)
($i=0; ...)
In my paper copy and the electronic version that I just downloaded (30 Jan 09) from the APress Website, the code in wrong near the top of page 47. Off by one error. Loop will terminate early. The problem does not exist in the downloadable code.
Chapter 3. Hooks, Actions, and Triggers, Page 48
Wed, 11/05/2008 - 6:14pm — jvandykarray_merge($info['user_block_user_action']['hooks']['comment'], array('insert'));
array_unique(array_merge($info['user_block_user_action']['hooks']['comment'], array('insert')));
array_merge() appends values instead of combining them when keys are numeric, as they are implicitly in the above array.
Chapter 3. Hooks, Actions, and Triggers, Page 48
Tue, 09/23/2008 - 2:08am — Sid_MChanging Existing Actions with drupal_alter
Changing Existing Actions with hook_action_info_alter
drupal_alter is a generic dispatching mechanism used for many hooks. That it is used to dispatch hook_action_info_alter is an irrelevant and confusing implementation detail. (Note: the same error should be corrected in the comment for the code example beneath the heading.)
Chapter 3. Hooks, Actions, and Triggers, Page 53
Wed, 04/21/2010 - 3:39pm — Leglaw"Beep multiple times" callback function as in the table description is printed in book as "beep_beep_action".
Should be:
callback: 'beep_multiple_beep_action'
Point is made clear -- just a small oversight on what the callback function of the configurable function 'beep_multiple_beep_action' is as opposed to the chapters non-configurable counterpart, 'beep_beep_action'.
Chapter 4. The Menu System, Page 70
Wed, 11/05/2008 - 5:59pm — jvandyk'page callback' => 'menufun_goodbye',
'page callback' => 'menufun_goodbye',
'access arguments' => array('receive greeting'),
The code relies on the inheritance of menu access callbacks. During the writing of the book, Drupal changed to no longer do inheritance so access arguments must be declared explicitly (see "Note for Module Developers" here). The code example slipped through final technical review of the book.
