After upgrading a larger project to 2.0 i got hundreds of errors that
need manual "corrections".
But some bug me more than others.
If you have User and Hotel models and you got HABTM between them you
sometimes want to use the join table to in order to get better queries
(left join etc).
In 1.3 this worked:
//Hotel.php
$this->bindModel(array('hasOne' => array('HotelUser')), false);
Afaik it uses AppModel instance and the HABTM information to set up
this model.
In 2.0 this fatal errors because it App::loads the Hotel again.
Actually - after some debugging - it tries to load hotel.php (note the
lowercase!) which of course on windows will load Hotel.php.
Result: A double include and PHP dies with "cannot redeclare class"
After quite some time I got it fixed by creating a "dummy file" named
HotelUser.php containing:
App::uses('AppModel', 'Model');
class HotelUser extends AppModel {}
But this might blow up at many other locations as well. Not sure if
this is now not supported anymore or a real bug.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php