The flawless upgrade to Cake 1.3

This article is over a year old and may contain outdated information.

Cake 1.3 has been around for quite some time now, but I never had the desire to upgrade with it being in such a beginning stage. Well seeing as how its now in Alpha and many users are testing it with no problems, I thought it would be a good idea. The project I was going to upgrade is quite large, heres a quick rundown of just how large:

19 controllers, 8 components, 15 locales, 64 models, 2 plugins, 6 vendors, 8 stylesheets, 14 javascripts, 7 helpers, 159 views

This isn't counting the admin panel, which is a whole separate app, and which I have not upgraded yet. Now lets get onto the upgrade, its probably the easiest thing to do. All I did was follow the migration guide. First off was checking to see if I used any deprecated methods, which was simple, all I did was search the whole app folder for words like del(. I was surprised to find I used it like 5 times, when I always preferred the full delete().

Next in the list was upgrading to the new Router conventions, which lucky for me didn't apply. I never used any non basic conventions, I mean why would you! One thing that bugged me though is the new page title implementation. It took me quite a while to go through all those controllers, and all the actions within them. Another nuisance was adding "echo" to all the flash() calls in the views, and removing the "inline" parameter from all meta() and css() calls, but wasn't too time consuming.

One of my most favorite updates was the new pagination support with passedArgs. I had to hack all my paging before, but in the new update I removed it all and it worked wonderfully! Thanks Cake team :]

All in all, the upgrade went smooth. If you follow Cake conventions all the way through, you don't need to do much alterations. I for one am looking forward to the future versions.

6 Comments

  • The update of new pagination support with passedArgs was indeed a useful one. I am not thinking to update it to the new one and hence would keep the pagination support update.
    assam tee ⋅
  • just wanted to report that the problem i stated above has been fixed in the current git rep (not the zipped version on the website) - along with some other things that were broken etc
    now i can say that switching from 1.2 to 1.3 has (almost) been as flawless as Miles stated
  • @Mark - I have yet to stress test the app, I merely upgraded it. I will be posting another blog of my experience with testing 1.3.
  • Glad to hear that the upgrade was mostly painless for you. We've tried really hard to make the upgrade to 1.3 as smooth as possible, and it seems we did an ok job at it.

    mark: I'll see what I can do about adding documentation on using ErrorHandler subclasses.
  • great to here that the update was not too complicated.
    i already did the same with some of my projects,
    couldnt publish the updated versions yet, though, due to the missing
    error handling

    in the 1.3 you now have to do the error handling (404 etc) yourself.
    do you have any idea how to accomplish that in the cake way?
    i mean, there is absolutely no documentation on that yet

    and without it the error messages are way to detailed
    like:

    Error: Create the class XyzController below in file: app\controllers\xyz_controller.php