Identified Issues
Scratching your head about something in the book? Start here

NOTE: All of the examples provided in the book were completed with Yii version 1.1.2. Many readers are using the latest stable version of Yii (currently 1.1.5) to following along with the examples in the book. There are some subtle API/method signature differences (esp in some of the Gii auto-generated code) between these two versions. If you are using any version other than 1.1.2 to following along, you may have to make some adjustments to the examples used in the book.

Typo/Printing: Preface, Page 1 -
The first section title reads: "What this book cover" it should read: "What this book covers" or "What is covered in this book"

Typo/Printing: Preface, Page 3 -
Under the Conventions section, it is describing how code words in the text are shown and it uses the sentence: "You can type in help to see a list of commands available to you within his shell" It should be "...this shell" (i.e. 'his' should be 'this')

Style Formatting: Page 20 -
The sentence:
"Your application has been created successfully under /Webroot/demo/"
should still be in code format style, as it is still part of the output from running the shell command.

Code Fragment: Page 105 -
The code does not explicitly include the class in which the method should reside. The function is fine, but it could be misleading. The public function

Typo/Printing: Page 142 -
The very beginning sentence on this page has several issues. The sentence as it is printed is impossible to understand. The entire sentence should read: "As these links originate from the issue details page, we can take advantage of the associated project, and alter the links to pass in the specific project id. We can then use that project id as the criteria to limit the Issues returned by the query in both the IssueController::actionIndex(), and IssueController::actionAdmin() methods."

Type/Printing: Page 142 -
There is a word 1/2 way down the page that is printed as "conssue", it should be "context": "...implemented a filter to enforce a valid project context"

Informational Note: Page 198 -
You might need to define the foreign key relationship on tbl_project_user_role.project_id to automatically handle deletes of rows in the project table. Otherwise, you might get a constraint violation error when the unit test ProjectTest::testDelete() is run.
in MySQL, something like

ON DELETE CASCADE ON UPDATE CASCADE

NOTE: The book is attempting to stay database independent, and the low level DDL statements for tables are intended to be general (i.e. not MySQL specific). However, the code available for download does have all of the MySQL specific statements used.

Code Typo: Page 249 -
In url manager configuration, site/commentFeed is printed, but it should be just comment/feed:

rather than using the CHtml::link method directly. (this format will still work, but is not consistent with the other menu items)

Code Typo: Page 91 - In the listed testCreate() function, the project column fields names need to be updated: 'createTime' should be 'create_time', 'createUser' should be 'create_user_id', 'updateTime' should be 'update_time' and 'updateUser' should be 'update_user_id'. The code still works and the test passes because the database will accept null values for these. But the names should be corrected.

Code comment at the bottom of page 205 incorrectly references password, when it should be "role" - code is correct, but the code comment is not accurate Should be // username and role are required

Typo - Page 113First paragraph under the heading "Adding a Filter", last sentence.IssueCcontroller should read: IssueController

Code Typo - Page 204 - in the testUserProjectAssignment() test method, 'project1' is incorrectly referenced, as it should be 'project2'. The correct method is:

Change the "enableClientValidation" parameter (one in each file) to a value of "false". Tests should now complete.

EDIT: Also, to prevent IE errors when running tests on a Linux system, delete the line in .../protected/tests/phpunit.xml that references the IE browser. When I deleted this and just left the line referencing the Firefox browser, all my test errors went away.

Hi Jeff. I'm still fairly new to PHP and web development in general and taking it one step at a time. I love the long tutorial format of your book and I'm working through it from start to finish. After that I'll look at building my own app with Yii. (we use it in work for a frontend of a large ecommerce site and it was my first exposure to a framework, so even though I'm not on that project anymore, I'm gonna stick with yii as a "first step" to learning how frameworks work.)

Anyway, your book is really helping me along the way but I thought I would let you know I ran into a spot of trouble on page 120 when trying to enter the SQL command (at the command line and in PHPMyAdmin):

...and the insert worked. I don't really know if that's an error in the book but it threw me for a few minutes. Perhaps you could clarify and delete this post if neccessary. Keep up the great work and I'll be buying your next book on yii too ;-) as I love your writing style.

at the bottom, the variable $comment is not defined. I havn't figured out what's the right variable to put there?
If I replace it with $model->comments, I will get an error
PHP Fatal error: Call to a member function isAttributeRequired() on a non-object in /var/www/html/yii/framework/web/helpers/CHtml.php on line 1166

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books maybe a mistake in the text or the code we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting hxxp://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from hxxp://www.packtpub.com/support.

It was frustrating to waste time there and then eventually find after googling around that the author is collecting corrections in this forum rather than in the support page his book says we should refer to.

Maybe I should submit a correction of Page 4 to PACKT's support so that they put an errata on their support page.

I've finished reading this book lately - from start to finish. Rarely do I have the time to invest, but this time I just took the time for that :-) .

Following is my list of feedback, mostly typos etc but a few comments as well.
I haven't checked if those are identified yet - forgive me in advance. I'm about to submit this errata to Packet Publishing. They should know too, despite voices saying things along the line of "its a lost battle".

Also, I'd like to comment that I liked the book a lot. I think its very good as a Yii beginner's book. Even if it has some issues and at least to me, getting the code to work on later chapters was problematic (I noted about this below...) its explanations are very good, its coverage is excellent, its depth is also good - not too much, not too shallow. Just to get intro into TDD with Yii was worth the purchase of the book. I'll submit my review of it in Amazon as well.

Stuff:
• pg 106, the big notice paragraph:I think the right magic function that relates to firing the 'non-defined' getOptions() method is __call() and not __get(). Yes, __get() is being used by Yii as well, when dereferencing AR model attributes that are not even defined in "our" model class but that's not the case at hand.
• pg. 109, second paragraph (starts with "This line is using the CActiveForm::labelEx()...". On the second line's beginning there's an extra "a" (seems like extra to me).
• pg. 118 - a link to the project 'view' view was added to create an issue for that project. all nice and dandy but the link to create a new issues that appears in multiple other issue-views needs to be commented out.
• pg 129. Yes, this actionView() code section has many mentions on the web. obviously - its faulty. I wonder why its not listed on the official errata page when so much time has passed since the error has been reported. i used actionView($id) (as it was from previous steps of the apps) and therefore simply used "array(':projectId' => $id),..." on the line that caused the problem.
• pg. 202 second bullet, mentions table "tbl_project_use_assignment". Should be "tbl_project_user_assignment".
• pg. 202 : this is a suggestion rather than typo or the like: the book isn't taking a tutorial with exercises approach so I would have slightly changed the approach of the text to lightly mention the option of implementation by the reader before reading the implementation ahead.
• chapter 9: beginning this chapter, I was unable to make your supplied code work with your supplied schema. By "supplied" I refer to what is available for download from Packet Publishing site. Every chapter's material should be working on its own and by chapter 9, where i dropped my old code in favor of your code (for reasons i describe in next issue), I was unable to make the code + (your) DB sing along. There was some problem in feeding in new projects - the create_user_id wasn't updated which led to other problems along the way. Due to time constraints I didn't debug this. Assuming that its not my fault, IMHO, you have to make sure that each chapter's material is self contained and "decoupled" from previous chapter's material if there's such a dependency. In specific - the data fed in previous chapters should not be relied upon in subsequent chapters. I'm not sure this is directly causing the problem I faced but In the supplied schema file there's only a couple of user's created and previous chapter's data was dropped, which led indirectly to a problem when creating new data (projects, issues...).
• Regarding the trackstar application database schema, I think that since this book is for Yii newcomers you should drop the tbl_* prefix where it was used in some tables names. Keep it simple and appropriate for the beginner nature of the learning state. I think that there's no need to overload the user with table name prefixes. That's an easy piece of the puzzle to catch up with later when the need arise. Its a nag to add the 'tbl_' prefix while using the book and querying using command line mysql client... .
• pg. 227, first paragraph. It says there that "the second parameter will allow us... to display *all* comments for a project...". That's not accurate. It will allow us to display *a limited* number of comments based on given $limit var, with defautl number of such comments as defined in the first parameter - $limit.
• pg. 230, first disc-bullet - same comment as above - there's no "get ALL comments" but rather "get all comments based on the default 'limit' (in findRecentComments()).
• pg. 228, first quoted code section: It says "...with('issues')" while I think it should be "with('issue')" as the relation name defined in Comment class is issue and not issues (singular vs. plural).
• pg. 233, the sentence right before the second code block: should state the path of the widget view as protected/components/view/recentComment.php and not renderComments.php. Similarly, in the bottom paragraph, it states the widget name to be RenderComments while its RecentComments.
• pg. 246, line 6 before page end - there's "set the set the". one "set" of "set the" should be deleted :-) .
• pg. 247, second paragraph: URL has a typo in the form of a mistyped space char:" localhost/trackstar /index.php.../ (note the bad space char...).

I am starting to work through this book. I have the recommended Yii version 1.1.2 but which versions of PHPunit and Selenium should be used for maximum compatibility/least pain? (I assume it would be best to use the versions that were active back when yii-1.1.2 was current?)

(All required software recommended versions should be posted in the first post here, yes?)

I am starting to work through this book. I have the recommended Yii version 1.1.2 but which versions of PHPunit and Selenium should be used for maximum compatibility/least pain? (I assume it would be best to use the versions that were active back when yii-1.1.2 was current?)

(All required software recommended versions should be posted in the first post here, yes?)

Also: Is Jeff still around here?

So far, loving yii!

I believe the versions used at the time of writing (now 2 years ago) were
PHPUnit 3.5.3
and
Selenium Server 1.0.3

FYI, I have just now completed all first drafts of a 2nd Edition of this book. The Second Edition will correct all of the errata published in the first book as well as brings everything up-to-date with latest version of Yii 1.1.12. Hopefully it will be released within the next month.

I know it's not like you have any control over what the publishers do once they have the material, but we're a month on now from this last statement, and I'm sure I'm not the only one checking this thread (and board) almost daily for news of an updated release.

As a resource it is tremendous, and a much-needed helping hand into Yii, but I desperately need current-version examples so I can understand what's going on under the hood.

I know it's not like you have any control over what the publishers do once they have the material, but we're a month on now from this last statement, and I'm sure I'm not the only one checking this thread (and board) almost daily for news of an updated release.

As a resource it is tremendous, and a much-needed helping hand into Yii, but I desperately need current-version examples so I can understand what's going on under the hood.

I found out that you can already buy the book in a "RAW" version directly from the publisher.

The book title changed to: Web Application Development with Yii and PHP