Book errata

8 messages Options
Embed this post
Permalink
Kieron

Book errata

Reply Threaded More More options
Print post
Permalink
Hi,

I have tried to find a list of the book's errata but to no avail - on the apress website I could only find a form to submit errata not a list of submitted errata.

I apologise if this is obvious and I have missed it, but I would appreciate anyone's comments or where I might find it!

Thanks,

Kieron
Emmanuel Becerra

Re: Book errata

Reply Threaded More More options
Print post
Permalink
One of the samples in the book is wrong Page 107:

 function findByYear($year=null) {
      $date = $year.'-01-01 00:00:00';
      $end_date = $year.'-12-31 23:59:59';
      return $this->find('all',array('conditions'=>array('DATE(Post.date)'=>'>'.$date,'DATE(Post.date)'=>'<'.$end_date)));
 }

The correct function is:

function findByYear($year=null) {
                $date = $year.'-01-01 00:00:00';
                $end_date = $year.'-12-31 23:59:59';
                return $this->find('all',array('conditions'=>array('DATE(Post.date) >' => $date,'DATE(Post.date) <' => $end_date)));
        }

I hope this helps.

Thanks!
Kieron

Re: Book errata

Reply Threaded More More options
Print post
Permalink
Thanks Emmanuel,

It's not the individual mistakes which may or may not be listed on this forum that I'm looking for but a list of ALL errata in one place.

Rather than find something in the code doesn't work and spend too long looking for, say, a missing single quote mark, I was hoping to find a list of each typo/mistake.

For example another mistake that is not mentioned on this forum except in an earlier example, (a thread by Duncan for 'Listing 8-12 concerning $ajax->link), can be found on P.165, 'Listing 9-3'.

$Ajax->link is used here again with listed tags being put inside an  tag. Although this works in some browsers it is incorrect usage and does not work in Firefox 3.

Hence to correct it, the <li> tags must be removed from $Ajax->link and blog.php must be changed as follows:

        $out .= '<div class="comment">
            <div id="vote_'.$comment['Comment']['id'].'">
            <div class="cast_vote">
            <ul><li>';
        $out .= $this->voteUpLink($comment['Comment']['id'],array('upLink'=>$up,'text'=>$upText,'update'=>$update));
        $out .= '</li><li>';
        $out .= $this->voteDownLink($comment['Comment']['id'],array('downLink'=>$down,'text'=>$downText,'update'=>$update));
        $out .= '</li></ul>
            </div>
            <div class="vote">'.$comment['Comment']['votes'].'</div>
            </div>
            <p>'.$comment['Comment']['name'].'</p>
            <p>'.$comment['Comment']['content'].'</p>
            </div>';

Cheers Kieron.
Jon Chin

Re: Book errata

Reply Threaded More More options
Print post
Permalink
I too have been looking for this (see my post on http://n2.nabble.com/source-files-for-book-td1367325ef573324.html ).  I finally found something in sort of (but not really) an obscure place on the publisher's site: http://apress.com/book/downloadfile/4046

It's great to have the code for each chapter--makes life easier.  It'd be nicer though to also have a full copy of all of the files of the end product.  That way we don't have to search through the chapters for the applicable code.
npm

Re: Book errata

Reply Threaded More More options
Print post
Permalink
THought I'd mention that somehow the findByYear function never made it into that collection of source code from the book, at least not in the Chapter07 or Chapter08 directories.
davidgolding

Re: Book errata

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kieron
Some errata have been suggested on Apress' site, and I've responded to a few. But I think it might be best to host the errata reports here. So far, this forum appears to be helping people through any problems in the book, for which I'm glad. But would a static page be best?
--Dave

Author, "Beginning CakePHP: From Novice to Professional"

[ get your copy at: http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/ ]
npm

Re: Book errata

Reply Threaded More More options
Print post
Permalink
It took me awhile to find this forum.  Maybe a link on your blog page to say "Report/Find Errata here" would help?  

Also, another thing that would help would be to freshen up the code examples with the latest CakePHP release and let people download them?  It seems like almost every chapter has several broken examples now due to API changes.  Finding fixes has been a little frustrating.
davidgolding

Re: Book errata

Reply Threaded More More options
Print post
Permalink
Great idea. This next month I'll make it a priority to get the code samples up to date with RC3. I'll host it here (davidgolding.net) and advertise it as much as possible.

As always, thanks for the feedback.
--Dave

Author, "Beginning CakePHP: From Novice to Professional"

[ get your copy at: http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/ ]