Tuesday, July 27, 2010

Problems with Cake 1.1 to 1.3.3 migration

Hi,
Im attempting to migrate an existing CakePHP 1.1 application to
the latest 1.3.3 and im running into a few problems that dont seem to
be covered in the migration guide, and id appreciate any help on
figuring out whats going wrong.

The first problem I am having is regarding loading and using models in
controllers, currently each controller has the models it requires
setup in the $uses array, for some models (notably Bookshelf and
Author) instead of loading the model class the default AppModel class
is loaded instead meaning the extra and overrriden model methods are
not found and a SQL error is generated. Ive seen similar reports to
this that where related to the filenames of php file containing the
model class being wrong but this doesnt seem to be the case for me as
the same filenames work fine in 1.1, but for the record the filenames
are as so:

bookshelves_controller.php => bookshelf.php (Class Bookshelf)
authors_controller.php => author.php (Class Author)

I also attempted to use $this->loadModel in the controller methods
instead of $uses with the same problem. Though I did find that by
using App::import('Model') in the controller methods, that the correct
model is loaded, which is odd because looking at the loadModel code in
cake/libs it seems to eventually call App::import('Model') with the
same data.

The second error I am having is that in some models the methods are
not seemingly not substituting the table/fieldnames correctly so the
model class name is used in the underlying sql queries, possibly
related to my other problem ??

Any help from anyone would be greatly appreciated.

Thanks in advance

MikeB

P.s. im using CakePHP 1.3.3 on ubuntu karmic (not from ubuntu package)
with PHP 5.2.10-2ubuntu6.4.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: