Errata (Second Edition)
This page lists the errors found in the book.
Chapter 8. The Theme System, Page 188
Thu, 10/29/2009 - 8:39am — jvandykprint theme('links', $secondary_links, array('class' => 'links primary-links'))
print theme('links', $secondary_links, array('class' => 'links secondary-links'))
The class set for the secondary links is 'links primary-links', buth should probably be 'links secondary-links'. Thanks to Johan Falk for reporting the error.
Chapter 8. The Theme System, Page 190
Wed, 11/26/2008 - 5:41am — guysabanOn page 189 the $picture variable is described. It is also discribed differently in the same list under a seperate listing on the next page (190).
Thanks for the book. I'm learning a lot.
Chapter 8. The Theme System, Page 195
Mon, 02/02/2009 - 9:07am — davbre87
/**
* Implementation of hook_theme().
*/
foo_theme() {
return array(
'breadcrumb' => array(
'arguments' => array('breadcrumb' => NULL),
),
);
}
/**
* Implementation of hook_theme().
*/
function foo_theme() {
return array(
'breadcrumb' => array(
'arguments' => array('breadcrumb' => NULL),
),
);
}
'function' is missing from code snippet
Chapter 8. The Theme System, Page 195
Tue, 09/02/2008 - 2:36pm — jvandyk
return array(
'breadcrumb' => array(
'arguments' => array ('breadcrumb' => NULL),
);
);
return array(
'breadcrumb' => array(
'arguments' => array('breadcrumb' => NULL),
),
);
Semicolon following array closure should be a comma. Also, extra space after array keyword.
Chapter 9. Working with Blocks, Page 213
Thu, 11/27/2008 - 10:02am — guysabanThe following line of code:
$blocks[0]['cache'] = BLOCK_NO_CACHE;
is missing from:
case 'list':
$blocks[0]['info'] = t('Pending comments');
return $blocks;
case 'list':
$blocks[0]['info'] = t('Pending comments');
$blocks[0]['cache'] = BLOCK_NO_CACHE;
return $blocks;
The block cache setting is missing from the approval.module code example on page 213. Its is included in all other examples of approval.module code in the "Building a Block" section.
Chapter 10. The Form API, Page 222
Fri, 10/03/2008 - 1:16pm — MoonshineThe Form API Diagram on p.222 has and incorrect flow for cached/posted forms.
The original diagram shows cached/posted forms re-entering the flow right before validation. Actually these forms are run through drupal_process_form() -> form_builder() regardless. (Which gives people a crack at things via #after_build before validation :) )
See http://codelica.com/misc/FAPI-diagram-corrected.jpg
[Thanks, and we've tried to get an updated diagram into the second printing. -JV]
Chapter 10. The Form API, Page 222
Wed, 02/18/2009 - 11:04pm — rfayDiagram shows a path from "Redirection set" over to the left side of the page, going down to "Is #cache true".
After the submit function(s) are run, there is *always* a redirect. If #redirect is set, it will be to the page specified there. Otherwise, the rediirect is to this same page. In that case, the whole thing starts over again, but without "submitted" being set. The text on p. 228 seems to have this right, but it's wrong in the diagram.
Chapter 10. The Form API, Page 222
Mon, 01/26/2009 - 11:43am — cquezelI think there is an arrow missing from Rebuild Form to the arrow leading to Render form elements
Add the arrow if it is realy an error
Chapter 10. The Form API, Page 222
Sun, 08/02/2009 - 5:06pm — lesmanahook_form_id_alter()
Should be hook_form_FORM_ID_alter().
Chapter 10. The Form API, Page 223
Mon, 10/06/2008 - 7:10pm — gpkNext, element_info() is called.
Next, _element_info() is called.
Incorrect function name. See http://api.drupal.org/api/function/_element_info/6 for API documentation of this function.
