Cake 1.2RC3 to Final
Recently the cake 1.2 has been released. On several of my applications I have upgrading all along the 1.2 release cycle. Here are my tweaks that I needed to do from RC3 to 1.2 Final.
To start the upgrade, I simply swapped out my cake directory for the new one. Dropped the tmp dir with this command.
find app/tmp/ -name ‘cake*’ | xargs rm
For the most part it worked right off the back. The only problem I had was to switch some things in my “app/app_controller.php”. In RC3, if it was an ajax request, it automatically switched to an ajax layout. It stopped doing that in RC4 and final. So I when to put functionality back in.
To start I added the request handler component and use beforeFilter().
var $components = array('RequestHandler'); function beforeFilter() { if ($this->RequestHandler->isAjax()) { $this->layout='ajax'; } }
I actually had several things happening in my ‘app/app_controller.php’ already, here is my actual file.
var $components = array('Auth', 'Email', 'RequestHandler'); function beforeFilter() { $this->Auth->fields = array('username'=>'username', 'password' => 'password'); $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login'); $this->Auth->allow('*'); $this->set('navPoint', 'home'); if (isset($this->params['admin'])) { $this->layout='admin'; $this->Auth->deny('*'); // Lets set the sort order if (!$this->Session->check('sort')) { $this->Session->write('sort', 'Application.date_created DESC'); } } if ($this->RequestHandler->isAjax()) { $this->layout='ajax'; } }

