Errata (Second Edition)
This page lists the errors found in the book.
Chapter 7. Working with Nodes, Page 141
Fri, 11/20/2009 - 11:09am — fchow8888I build the projects as described. I downloaded the Joke content type code directly from this site, but I get the following error message in the Drupal admin console:
This version is incompatible with the 6.14 version of Drupal core.
[You are using the downloadable code from the first edition of the book, which works only with Drupal 5. Download the code for the second edition of the book, which works with Drupal 6.]
Chapter 7. Working with Nodes, Page 146
Fri, 04/23/2010 - 9:49am — Leglawfunction joke_form($node) {
Should be:
function joke_form(&$node) {
In print, parameter $node should be passed by reference since it can be altered / augmented in within hook_form.
Chapter 7. Working with Nodes, Page 150
Wed, 11/05/2008 - 6:53am — peamikfunction joke_delete(&$node) {
function joke_delete($node) {
Unnecessary passing of parameter $node by reference
Chapter 7. Working with Nodes, Page 154
Wed, 07/30/2008 - 4:47pm — jvandykDrupal will automatically include the JavaScript file that enables collapsibility.
The sentence should be deleted.
This is true for fieldsets in forms that use the #collapsible property, but not for template files.
Chapter 7. Working with Nodes, Page 154
Tue, 02/10/2009 - 12:10pm — colinahThere seems to be a further required step missing here as there is nothing to load the required collapse.js script.
Inserting the line:
drupal_add_js('misc/collapse.js');
into the joke_load function makes the collapsible field work.
A missing paragraph?
Chapter 7. Working with Nodes, Page 154
Wed, 01/21/2009 - 3:00pm — ccurveythe fields are not collapsed automatically. With drupal 6.8, I can find no file named "collapsible.js" in the distribution. At http://www.drupalbook.com/node/137, there is mention that the collapsing Javascript is included automatically only in forms, but even adding form tags to the page does not seem to make the collapsability thing work.
Did I miss something about turning on JS includes?
[The file that contains the JS is at misc/collapse.js. Drupal's fieldsets are collapsible by default. -JV]
Chapter 7. Working with Nodes, Page 157
Wed, 01/07/2009 - 10:53am — LeglawDesicion box, "Providing module implements view hook?" The "No" branch leads to "Call hook_view() on providing module". If this is intended, the structure is counter-intuitive and should be explained in detail. If a module does not implement hook_view(), how is it being called?
It seems the Yes and No branch should be switched.
[Correct -- the Yes and No branch are reversed. -JV]
Chapter 8. The Theme System, Page 170
Thu, 10/09/2008 - 2:46pm — mikewhobikes<div id="left">
<div id="sidebar-left">
This div has an ID of "sidebar-left" on all of the code that follows.
Chapter 8. The Theme System, Page 174
Thu, 10/09/2008 - 5:50pm — mikewhobikes3 new additions to the code have not been made bold.
The following portions should be bold for consistency:
<?php print $breadcrumb ?>
<?php print $title ?>
<?php print $closure ?>
Minor formatting inconsistency.
Chapter 8. The Theme System, Page 181
Sat, 03/13/2010 - 10:17am — usurperThe snippet used to override the breadcrumb seems to be incorrect. When following the guidelines, the order Drupal pulls this information is either incorrect in the book, or is coded incorrectly.
The theme registry needs to be cleared in order for new template overrides to be active.
To clear the theme registry, do one of the following things:
1. On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.
2. With devel block enabled (comes with devel module), click the "Empty cache" link.
3. The API function drupal_rebuild_theme_registry.
More information can be found here: http://drupal.org/node/173880#theme-registry
