-
Notifications
You must be signed in to change notification settings - Fork 0
Migration Guide
Before 5.7, you could retrieve the "current page" variable using either Page::getCurrentPage() or global $c. As of 5.7, however, you must only use Page::getCurrentPage(). So if your old code looked like this:
global $c;
echo $c->getCollectionName();
...you should change it to this:
$c = Page::getCurrentPage();
echo $c->getCollectionName();
Concrete5.7 introduces the use of php namespaces in lieu of the various Loader::xxxxx() functions (e.g. Loader::model(), Loader::library(), etc.). See http://andrewembler.com/posts/concrete5-5-7-add-on-development-part-1/ for more info.
Dashboard page controller files used to be structured like so:
controllers
|- dashboard
|- reports
|- my_custom_dashboard_page.php
...but now you must add a new single_page directory underneath the top-level controllers directory:
controllers
|- single_page
|- dashboard
|- reports
|- my_custom_dashboard_page.php
See http://andrewembler.com/posts/concrete5-5-7-add-on-development-part-1/ for more details.
See "Block UI" section of http://andrewembler.com/posts/concrete5-57-add-on-development-part-2/
See "Confirm Signup Single Page" and "Dashboard Reports Page" sections of http://andrewembler.com/posts/concrete5-57-add-on-development-part-2/
ADODB is being replaced by Doctrine DBAL. Most of the ADODB functions will continue to work (see https://github.com/concrete5/concrete5-5.7.0/blob/master/web/concrete/core/Database/Connection.php), but some cannot be translated automatically so you will need to manually modify any of your code that uses these:
-
AutoExecute: Doctrine DBAL has similar functionality, but instead of being combined into one function (like it was with ADODB), there are two separate functions:insert()andupdate(). Note that for theupdate()function, you must pass in an array offield => valuepairs for the 3rd argument, as opposed to ADODB'sAutoExecutefunction which had you passing in a portion of a SQL WHERE clause. For example, if your old code looked like this:$table = 'MyThings'; $data = array( 'name' => 'John Smith', 'email' => 'john@example.com', 'phone' => '555-1212', ); $db->AutoExecute($table, $data, 'UPDATE', 'id = 3');
...you should change it to this:
$table = 'MyThings';
$data = array(
'name' => 'John Smith',
'email' => 'john@example.com',
'phone' => '555-1212',
);
$db->update($table, $data, array('id' => 3);
TODO