Errata (First Edition)

This page lists the errors found in the first edition of the book.

Chapter 3. Module-Specific Settings, Page 27

Location on the page: 
1st code block
Error: 

Not sure if this is an error, but I was wondering why the $form['array_filter'] line was removed, without explanation.

Description of the Error: 

[See bottom of page 15. It is only needed for multiple checkbox values. -JV]

Chapter 3. Module-Specific Settings, Page 28

Location on the page: 
Last line
Error: 

The text refers to "turning the field red, as shown in Figure 3-4." My copy of the book is B&W, so this is rather meaningless.

Correction: 

Perhaps a pointer could be included in Figure 3-4, pointing to the field that changes color.

Description of the Error: 

Use of color in a B&W book.

[The entire phrase is this is reflected on the screen in a warning message and by turning the field value red, as shown in Figure 3-4. The reference to the figure is for the warning message, not the color change. -JV]

Chapter 3. Module-Specific Settings, Page 28

Location on the page: 
Middle of page, in code block
Error: 

Two instances:

'#default_value' => variable_get('annotate_deletion', 0) // default to Never

and

'#size' => 3

Correction: 

Two instances:

'#default_value' => variable_get('annotate_deletion', 0), // default to Never

and

'#size' => 3,

Description of the Error: 

To adhere to Drupal coding standards, the last array element should be followed by a comma.

Chapter 3. Module-Specific Settings, Page 28

Location on the page: 
near bottom
Error: 

if (!is_numeric($form_values['annotation_limit_per_node'])) {

Correction: 

if (!is_numeric($form_values['annotate_limit_per_node'])) {

Description of the Error: 

The form value annotation_limit_per_node doesn't exist, but annotate_limit_per_node does.

Chapter 3. Module-Specific Settings, Page 29

Location on the page: 
Using Drupal's variables Table section
Error: 

Three occurrences:
Drupal has a variables table in the db...
field to the value stored in the variables database table...
retrieved in the variables table

Correction: 

Drupal has a variable table in the db...
field to the value stored in the variable database table...
retrieved in the variable table

Description of the Error: 

The table in question is named 'variable', not 'variables'.

Chapter 3. Module-Specific Settings, Page 31

Location on the page: 
Last line of second paragraph.
Error: 

Refers to "menu.module" without its full relative path, unlike "menu.inc" which is referred to as "includes/menu.inc" on the previous line (ie. with its full relative path).

Correction: 

Replace "menu.module" with "modules/menu/menu.module".

Description of the Error: 

Small omission.

Chapter 4. The Menu System, Page 34

Location on the page: 
Code for mymenu.info
Error: 

; $Id $
name = "Mymenu Module"
description = "Adds a menu to the navigation block."
version = "$Name$"

Correction: 

; $Id $
name = Mymenu Module
description = Adds a menu to the navigation block.
version = "$Name$"

Description of the Error: 

Parentheses improperly added to Name and Description lines of mymenu.info file. Code in code repository is correct.

[I think you mean quotation marks, not parentheses. They are optional. Do note that the line version = "$Name$" is no longer necessary and is discouraged. -JV]

Chapter 4. The Menu System, Page 37

Location on the page: 
First code sample
Error: 


if (!isset($name)) {
$name = t('good looking!');
}

Correction: 


if (!isset($name)) {
$name = t('good looking');
}

Description of the Error: 

When $name is emitted later in the code, an exclamation is added there, so it's not needed in $name. This is corrected in the second code sample on the page.

Chapter 4. The Menu System, Page 39

Location on the page: 
Last line of the page
Error: 

'access' => user_access('receive greeting') // Returns TRUE or FALSE.

Correction: 

'access' => user_access('receive greeting'), // Returns TRUE or FALSE.

Description of the Error: 

To adhere to Drupal coding standards, the last array element should be followed by a comma.

Chapter 4. The Menu System, Page 41

Location on the page: 
Figure 4-4
Error: 

The column headings on the table are difficult to read as slanted text.

Correction: 

Not sure, perhaps rotate the column headings to fully vertical.

Description of the Error: 

Hard to read text.