Errata (Second Edition)

This page lists the errors found in the book.

Chapter 16. Sessions, Page 367

Location on the page: 
3rd paragraph - Caution
Chapter: 
16. Sessions
Error: 

Drupal doesn't store session information the first time an anonymous user visits a site. This is to keep evil web crawlers and robots from flooding the sessions table. As a developer, this means you cannot store session information for the first visit from an anonymous user.

Correction: 

Drupal doesn't usually store session information the first time an anonymous user visits a site. This is to keep evil web crawlers and robots from flooding the sessions table. As a developer, you should try to avoid storing session information for the first visit from an anonymous user.

Description of the Error: 

Drupal will store session information for the first page view from an anonymous visitor if data has been stored in $_SESSION. See http://api.drupal.org/api/function/sess_write/6.

Chapter 16. Sessions, Page 370

Location on the page: 
Below Table 16-2
Chapter: 
16. Sessions
Error: 

This is only done if the browser has presented a valid cookie to avoid bloating the sessions table with sessions for web crawlers.

Correction: 

To avoid bloating the sessions table with sessions for web crawlers, this is only done if the browser has presented a valid cookie, or if data has been stored in $_SESSION (e.g. by a module).

Chapter Front Matter, Page 393

Location on the page: 
Building a jQuery Voting Widget
Chapter: 
Front Matter
Error: 

create the file plus1.info

Correction: 

create the file plusone.info

Chapter 17. Using jQuery, Page 401

Location on the page: 
line 7 of function theme_plusone_widget
Chapter: 
17. Using jQuery
Error: 

Users without the 'rate content' permission are not eligible to vote. Treat them the same as the author when theming the widget.

Correction: 

replace 'if ($is_author) {' with 'if ($is_author || !user_access('rate content')) {'

Description of the Error: 

Users without 'rate content' permission are not permitted to access /plusone/vote/, so ajax or browser post fail for them.

Chapter 18. Localization, Page 416

Location on the page: 
Subtitle of Figure 18.11
Chapter: 
18. Localization
Error: 

A list of translatable strings containing the word "search" (...)

Correction: 

A list of translatable strings containing the word "Search" (...)

Description of the Error: 

In the example showed on the figure the word "Search" was the one we
searched for. "Search" is not the same as "search" because for the Locale
Module the case of letters in strings matters.

Chapter 23. Installation Profiles, Page 553

Location on the page: 
bottom
Chapter: 
23. Installation Profiles
Error: 

call to university_profile_tasks()

Correction: 

downloaded code for the profile uses university_profile_final() instead

Description of the Error: 

using hook_profile_tasks() results in db_query being undefined. hook_profile_final() which isn't even in the drupal api avoids this.