[solved] Crud controllers: Cannot find Controller class after upgrade

I’ve just upgraded a project from 1.1b to the current build of 1.1. Now when I use the yiic crud command to generate code and then view it in a browser, I’m getting two errors:

Firstly, the new controller extends Controller, and not CController as it has previously. PHP can’t find Controller so I get an undefined class error. Then when I change Controller to CController I get another error from the view:


Property "VacancyController.breadcrumbs" is not defined.

This is caused by this code in the crud generated view:




<?php

$this->breadcrumbs=array(

	'Jobs Vacancys',

);

?>



Obviously I’ve cocked something up in the upgrade. Any thoughts?

You should read the changelog before updating. With that said, now you should probably generate a blank web app and copy the the files like protected/components/Controller.php and any other if necessary, have your controllers that CController extend Controller. There were other changes made for 1.1 such as the alias for the table in a relation etc…

Nice one, thanks a lot. I did read the upgrade bits in both the Definitive Guide and in the download area but nothing was mentioned about this. It’s also worth noting that all the CSS styles have changed, so any newly generated CRUD views are going to be incompatible with the old CSS files.