Today, the beta version of CakePHP 1.2 has been released (see the announcement) and the website got a new design, which is really nice.

Here some things I noticed while upgrading Noserub from pre-beta to beta:

The folder “cake/locale” has been removed. It contained the template for translating the core. It seems this file has been moved to the translations project on CakeForge.

The files AppController, AppModel, and AppHelper have been moved from “cake” to “cake/libs/controller”, “cake/libs/model”, resp. “cake/libs/view/helpers”.

The folder “cake/libs/view/templates” has been removed and its subfolders are now direct subfolders of “cake/libs/view”.

In “app/config/sql” three files have been added: “db_acl.php”, “i18n.php”, and “sessions.php”.

In “app/config/core.php” the constant COMPRESS_CSS has been removed. On the other hand three new config entries were added: “App.encoding”, “Asset.filter.css”, and “Asset.filter.js”. The two latter are commented out by default.

While running the application I got some messages that the functions loadModel(), listClasses() and Model::generateList() are now deprecated. Thanks to the help messages it was easy to fix them.

The only bigger issue I encountered up to now was a change in the API for writing custom validation methods. Here some code from my model to illustrate the problem:

var $validate = array('passwd2'  => array('rule' => 'validatePasswd2'));

function validatePasswd2($value, $params = array()) {
    if ($this->data['Identity']['passwd'] !== $value) {
        return false;
    } else {
        return true;
    }
}

This code worked fine with the pre-beta, but with the beta version the type of $value has been changed, it is now an array instead of a string (see the explanation for ticket 3797). And so the code above will always return false. To fix it, the comparison has to be changed to:

if ($this->data['Identity']['passwd'] !== $value['passwd2'])

That’s it, good luck with upgrading :)