Identified Issues

The book itself says:

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.

Hi,

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 :slight_smile: .

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 :slight_smile: .

• 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…).

[size="5"]¡This is an important one![/size]

On Page 207, code says:




public function actionAdduser()

    {

        $form=new ProjectUserForm;

        $project = $this->loadModel();



And it should be:




public function actionAdduser($id)

    {

        $form=new ProjectUserForm;

        $project = $this->loadModel($id);



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!

RE 11-NOTE: the code available for download from the packt site doesn’t have any sql scripts at all. Is there another source for the code?

You can download from github: https://github.com/jefftulsa/TrackStar

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.

You could use following IssueController::loadModel() method instead of one mentioned on page no. 231


public function loadModel($id, $withComments=false)

	{

		if(isset($id))

		{

			if($withComments)

			{

				$model = Issue::model()->with(array('comments' => array('with' => 'author')))->findbyPk($id);

			}

			else

			{

				$model = Issue::model()->findbyPk($id);

			}

		}

		if($model === null)

			throw new CHttpException(404, 'The requested page does not exist.');

		return $model;

	}

along with call to the actionView() method as -


$issue=$this->loadModel($id, true);

Page 220




public function actionView()

{

	$issue=$this->loadModel();

	$comment=$this->createComment($issue);

		

	$this->render('view',array(

		'model'=>$issue,

		'comment'=>$comment,

	));

}



Should be:




public function actionView($id)

{

	$issue=$this->loadModel($id);

	$comment=$this->createComment($issue);

		

	$this->render('view',array(

		'model'=>$issue,

		'comment'=>$comment,

	));

}



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

Here is the link:

http://www.packtpub.com/agile-web-application-development-with-yii-second-edition/book

Did they deliver it? That sites looks like a pre-order- with delivery (hopefully) sometime in December 2012.

Yes. I received the ebook immediately. When the FINAL version is released (maybe they add an extra chapter,etc) then the people who bought the raw version will receive the final version also. That is how it works.

Yes, the book has been now been published and is available in electronic and print formats.

I´m trying to use trackstar code from github repository, but for unknown reason "yiic migrate" does not work on my system.

Is there a place where I can download a full SQL dump ?

Are you referring to the codebase accompanying the new edition (2nd edition)?

If so, then sure:

visit this website to learn yii http://www.yiitutorial.com/

visit this website to learn yii http://www.yiitutorial.com/

I found this in the view file from the addUserAction:




....


<?php if(Yii::app()->user->hasFlash('success')):?>


<div class="successMessage">

<?php echo Yii::app()->user->getFlash('success'); ?>

</div>


<?phpendif; ?> <--- here is the error!


...




should be:





...


[code]<?php if(Yii::app()->user->hasFlash('success')):?>


<div class="successMessage">

<?php echo Yii::app()->user->getFlash('success'); ?>

</div>


<?php endif; ?> 


...



Don’t know the exectly site, cause i use the ebook version but i would guess its round about site 200.

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.)