Errata (Second Edition)
This page lists the errors found in the book.
Chapter 10. The Form API, Page 249
Mon, 09/15/2008 - 10:56am — jvandykfunction formwizard_multiform(&$form_state = NULL) {
function formwizard_multiform(&$form_state) {
On PHP 4, the above will fail with PHP Parse error: parse error, unexpected '=', expecting ')' in /sites/all/modules/custom/formwizard/formwizard.module on line 34 because PHP 4 does not allow assignment of values to variables passed by reference.
Reported by Mike Volmar.
Chapter 12. Searching and Indexing Content, Page 304
Fri, 04/10/2009 - 5:59am — pawel.traczynskidb_query("INSERT INTO technote VALUES ...
db_query("INSERT INTO {technote} VALUES ...
You have to include '{' and '}' brackets, so the database engine can add table prefix (if needed) to the table name.
Chapter 12. Searching and Indexing Content, Page 306
Fri, 04/10/2009 - 5:51am — pawel.traczynskivariable_set('legacysearch_cron_last', $last_change);
variable_set('legacysearch_cron_last_change', $last_change);
On the listing of the legacysearch.module the variables
'legacysearch_cron_last_id' and 'legacysearch_cron_last_change' are pulled
out from the database using variable_get. Later in the code the
legacysearch_update_shutdown() function uses variable_set to store those
variables in the database and at this time they have names
'legacysearch_cron_last_id' which is correct and 'legacysearch_cron_last'
which should be 'legacysearch_cron_last_change'.
Chapter 12. Searching and Indexing Content, Page 307
Fri, 04/10/2009 - 5:54am — pawel.traczynskivariable_del('legacy_cron_last');
variable_del('legacy_cron_last_change');
See description of error on page 306
Chapter 14. Working with Taxonomy, Page 337
Thu, 07/23/2009 - 5:33am — soxofaanis_null(taxonomy_vocabulary_load($vid))
taxonomy_vocabulary_load($vid) === FALSE
taxonomy_vocabulary_load($vid) does not return NULL when the vocabulary does not exists, but FALSE. see http://api.drupal.org/api/function/taxonomy_vocabulary_load/6
Chapter 14. Working with Taxonomy, Page 340
Wed, 10/01/2008 - 10:18am — Ulrich Müllerdrupal_mail('taxonomymonitor-notify', $to, $subject, $body);
drupal_mail('taxonomymonitor', 'notice', '$to, $language, $params);
Plus a new function is needed, taxonomymonitor_mail(), as an implementation of hook_mail().
The API of drupal_mail has changed. The code used in the book is for DRUPAL 5.
[Ulrich is correct. The module uses the old function signature. I swear I remember testing this module, though. I will update the downloadable code with the new version. -JV]
Chapter 15. Caching, Page 356
Fri, 04/10/2009 - 6:12am — pawel.traczynski(DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE)
_drupal_bootstrap(DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE)
Chapter 15. Caching, Page 360
Wed, 08/20/2008 - 10:44am — jvandykcache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = null)
cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = null)
The order of the second and third parameters are switched.
Chapter 15. Caching, Page 361
Wed, 08/20/2008 - 10:48am — jvandykcache_set($cid, 'cache_filter', $text, time() + (60 * 60 * 24));
cache_set($cid, $text, 'cache_filter', time() + (60 * 60 * 24));
Order of second and third parameters are switched.
Chapter 16. Sessions, Page 365
Mon, 09/08/2008 - 8:34am — gpk... PHP issues the browser a cookie containing a randomly generated 32-character ID, called PHPSESSID by default.
... PHP issues the browser a cookie containing a randomly generated 32-character ID. The name of the cookie is a 36-character string such as SESS41847725f5e919b45880017743781461 (which is the cookie name for this site). The apparently random 32-character ID that follows SESS is actually an MD5 hash based on the base URL of the site, or on the cookie domain if set in settings.php.
The examples of HTTP response and request headers also show the cookie name to be PHPSESSID, where it should be of the form described above.
