Errata
The following items apply to the first edition (USA, UK and Canada).
- Chapter 2, Page 45
The article on building a modular application with the Zend Framework by Jeroen Keppens has moved to the URI http://www.amazium.com/blog/create-modular-application-with-zend. - Chapter 3, Page 51
The calls toaddFilter('HTMLEntities')
is incorrect. The correct code isaddFilter('HtmlEntities')
. - Chapter 3, Page 75
The first paragraph incorrectly states that validator-specific options should be passed as the third argument to theaddFilter()
method. The correct method is theaddValidator()
method. - Chapter 3, Page 83
The calls toaddFilter('HTMLEntities')
is incorrect. The correct code isaddFilter('HtmlEntities')
. - Chapter 4, Page 126
The URL to the first catalog item is incorrectly written ashttp://square.localhost/catalog/item/1
. It should behttp://square.localhost/catalog/item/display/1
. - Chapter 5, Page 131
The call tonew Zend_Form_Element_TextArea('SellerAddress')
is incorrect. The correct code isnew Zend_Form_Element_Textarea('SellerAddress')
. - Chapter 5, Page 133
The call tonew Zend_Form_Element_TextArea('Description')
is incorrect. The correct code isnew Zend_Form_Element_Textarea('Description')
. - Chapter 5, Page 133
The calls toaddFilter('HTMLEntities')
is incorrect. The correct code isaddFilter('HtmlEntities')
. - Chapter 5, Page 135
The call toDoctrine_Query::create()->from('Square_Model_type t')
is incorrect. The correct code isDoctrine_Query::create()->from('Square_Model_Type t')
. - Chapter 5, Page 143
The text fails to mention that, to fully replicate the layout in Figure 5-7, you must also download the watermark image referenced in the CSS file. This image can be found in the code archive for the chapter. - Chapter 5, Page 146
The file name for the view script is incorrectly specified as$APP_DIR/application/modules/.../index.php
. The correct file name is$APP_DIR/application/modules/.../index.phtml
. - Chapter 5, Page 149
The view script for theCatalog_AdminItemController::successAction()
is not included in the text due to space constraints. This script can be obtained from the code archive for the chapter. - Chapter 5, Page 156
The file name for the view script is incorrectly specified as$APP_DIR/application/modules/.../update.php
. The correct file name is$APP_DIR/application/modules/.../update.phtml
. - Chapter 5, Page 157
The secondaddWhere()
clause in the Doctrine SQL query incorrectly refers to a field namedDisplayUntilDate
. The correct field name isDisplayUntil
. The revised clause should readaddWhere('i.DisplayUntil >= CURDATE()');
. - Chapter 5, Page 166
The location for the view script is incorrectly specified as$APP_DIR/application/modules/.../views/login/login.phtml
. The correct location is$APP_DIR/application/modules/.../views/scripts/login/login.phtml
. - Chapter 6, Page 178
The file name for the view script is incorrectly specified as$APP_DIR/application/modules/catalog/views/scripts/search.php
. The correct file name is$APP_DIR/application/modules/catalog/views/scripts/item/search.phtml
. - Chapter 6, Page 187
The'SalePriceMin'
and'SalePriceMax'
fields for the Lucene search index are incorrectly specified. The correct code is:
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('SalePriceMin', $r['SalePriceMin'])); $doc->addField(Zend_Search_Lucene_Field::UnIndexed('SalePriceMax', $r['SalePriceMax']));
. - Chapter 7, Page 203
The first paragraph incorrectly states that the number of items displayed per page is 4. The correct number is 5 items per page, as shown in the code listing on Page 202. - Chapter 7, Page 235
The$localConfig
variable in theindexAction()
method is incorrectly defined. The correct code is:
$localConfig = new Zend_Config_Ini($configs['localConfigPath']);
. - Chapter 9, Page 287
The Spanish translations for 'dog' and 'cat' have been transposed. The correct translations are 'gato' for 'cat' and 'perro' for 'dog'.
Troubleshooting
- Chapter 1, Page 13
If you're unable to see the default welcome page when accessing the virtual hostsquare.localhost
, try adding an entry for the host to your hosts file (/etc/hosts
on Linux or/Windows/System32/drivers/etc/hosts
on Windows. - Chapter 2, Page 33
If you see a "File not found" error after implementing the modular directory layout and accessing the URLhttp://square.localhost/default/index/index
, check that the new virtual host supports.htaccess
overrides. You can enable this by adding the following lines to your virtual host configuration, remembering to change the directory path to your virtual host's document root. - Chapter 3, Page 90
If you're unable to see an image CAPTCHA, verify that your PHP build includes support for the GD library. - Chapter 4, Page 107
The source code and example application in the book use Doctrine v1.1.4. The instructions apply only to Doctrine 1.x and will fail when used with Doctrine 2.x. The stable version of Doctrine 2.x was released after the book's publication date and is therefore not covered in the book. You can download an older version of Doctrine from here. - Chapter 4, Page 114
If you're unable to auto-generate the Doctrine models, try updating the call toDoctrine::generateModelsFromDb
toDoctrine_Core::generateModelsFromDb
. This is a change in newer versions of Doctrine. - Chapter 5, Page 161
In order to log in to the administration module, a user record must first exist in the database. Readers may manually INSERT this record into the database. The source code archive includes an SQL file with an example of the necessary INSERT statement. - Chapter 5, Page 147
Some users have reported issues with the checkbox size in$APP_DIR/application/modules/.../admin-item/index.phtml
. To correct this, update the style rule for each checkbox to read<input type="checkbox" name="ids[]" ... style="width:10px" />
. - Chapter 9, Page 307
If you see PHP notices about an undefined$locale
variable, update the_initLocale()
function with an additionalisset()
call, as shown below:
if (!isset($locale) || $locale === null) {
try {
...
<Directory "/usr/local/apache/htdocs/square/public">
AllowOverride All
Options All
</Directory>
Found a bug or error in the text? Go ahead and report it to the author.