BEdita 3.2 comes with CakePHP 1.3.x series that introduces some changes. You can see a full guide to migrate CakePHP 1.2.x to 1.3.x in CakePHP cook book, here instead we'll discuss what you have to change in your frontend apps to work properly.
First of all replace in your frontend apps config/core.php and webroot/index.php. You can use the corresponding files bundles in BEdita 3.2, for example copy frontends/dummy.example.com/config/core.php and frontends/dummy.example.com/webroot/index.php to the corresponding paths of your frontend apps.
Router
A small change has also been done to routing params. Routed params should now only consist of alphanumeric chars, - and _ or /[A-Z0-9-_+]+/
. This involve frontend-app/config/route.php because the old rule:
Router::connect( '/(?!pages)(.*)', array( 'controller' => 'pages', "action" => "route" ) );
will not work anymore. Replace it with:
Router::connect( '/*', array( 'controller' => 'pages', 'action' => 'route' ) );
It has to be the last router rule and it delegates routing to FrontendController::route() method.
Config
The bootstrap chain is changed, now all necessary configurations file are included from bedita.ini.php, so edit frontend-app/config/frontend.ini.php replacing:
require_once(BEDITA_CORE_PATH . DS . "config" . DS . "bedita.ini.php") ; if (file_exists (BEDITA_CORE_PATH . DS . "config" . DS . "bedita.cfg.php") ) { include(BEDITA_CORE_PATH . DS . "config" . DS . "bedita.cfg.php") ; } if (file_exists (APP. "config" . DS . "mapping.cfg.php") ) { include(APP. "config" . DS . "mapping.cfg.php") ; }
with:
require BEDITA_CORE_PATH . DS . "config" . DS . "bedita.ini.php"; include(APP. "config" . DS . "mapping.cfg.php");
The modelBinding structure has changed: GeoTag is part of BEObject. In frontend-app/config/frontend.ini.php use GeoTag 'inside' BEObject, like in the following example:
$config['modelBindings'] = array( 'Document'=>array( 'BEObject'=>array( "LangText", "RelatedObject", "GeoTag" ) ), //... );
View and Helpers
HtmlHelper::css()
no longer has an$inline
parameter. Use$options['inline']
instead, for example if you had:
{$html->css("ui.datepicker", null, null, false)}
you have to change it to:
{$html->css("ui.datepicker", null, ['inline'=>false])}
flash()
no longer auto echos. If you used Smarty as a template engine you should replace:
{if $session->flash('error')}{/if}
with:
{$session->flash('error')}
and similar.
Moreover inSessionComponent::setFlash()
second param is used for setting an element instead of layout, so in your applications you will need to:- Move message.tpl from views/layouts into views/elements
- In message.tpl rename
$content_for_layout
variable to$message
- JavascriptHelper is deprecated, you should replace:
$javascript->link()
with:
$html->script()
- The array of smarty
assign_concat
function now must begin from 1 MediaProviderHelper::$themeWeb
no longer exist
BEdita modules (CakePHP plugins)
Support for vendors/css, vendors/js, and vendors/img in plugin (bedita module) has been removed. They have been replaced with plugin (bedita module) webroot directories.
If you are using some additional modules you should update them.
If you created a personalized module you have to move your_module/vendors/css, your_module/vendors/js, your_module/vendors/img folders in your_module/webroot relative folders.
Frontend callbacks
If you used the nickname's callback feature in your PagesController you have to change the name because now the nickname is camelized to make the callbacks consistent with other methods names. In practice:
3.1 (old)
With this-is-my-content
it called this_is_my_contentBeforeFilter()
, ....
3.2 (new)
With this-is-my-
content
it calls thisIsMyContentBeforeFilter()
, ...