A [BC BREAK] means the update will break the project for many reasons:
- new mandatory configuration
- new dependencies
- class refactoring
- remove the
use_streamed_response
option to fix cache handling, it is not possible to compute cache with a streaming response
- [BC BREAK] Inline edition has been deprecated, see UPGRADE-2.3 for more information.
- It is now possible to add block from the admin backend
- Add new block in the base_layout.html.twig file. Add new deprecated blocks
-
[BC BREAK] A new
type
field has been added in Page and Snapshot models. This new field is used to identify apage service
that manages pages for a given type.Database Migration: (replace table name)
ALTER TABLE page__page ADD type VARCHAR(255) DEFAULT NULL; ALTER TABLE page__snapshot ADD type VARCHAR(255) DEFAULT NULL;
-
The
PageRenderer
class has been dropped and replaced by the page service workflow. When a page must be rendered, it now uses the page service associated to the page type. A default page service has been created to provide the same behavior as the previous workflow so there is not need to specify a page type for existing pages. -
The templates management has also been completely refactored into a
TemplateManager
class. This class is now responsible to render a template code.
-
[BC BREAK] The front page editor has been completely redesigned.
Assets
page.js
andpage.css
have been rewritten to provide new functionality to the front page editor.Templates for base blocks and container blocks have been updated to provide additional information on blocks when in the front editor mode.
BlockInteractor
has itssaveBlocksPosition()
method updated. It now performs unit updates and does not require a tree structure anymore.The BlockManager interface and class have been updated to implement a
updatePosition()
method. -
[BC BREAK] The container layout setting is now used to decorate inside the block div instead of decorating outside.
-
[BC BREAK] Integrate the SymfonyCmfRoutingExtraBundle from the CMF project
sonata_page_url
will raise an exception, just use thepath
twig helperNo more
catchAll
routing, now the routing is handled by theChainRouter
serviceIntroduce a
pageAlias
field, so this field will be used to generate an url using the a code defined in thePage
entity. This can be a nice feature if you want to generate a link from a template but without knowing the url defined by an user in the backend.For performance issue, the
pageAlias
must be prefixed by_page_alias_
, this will avoid extra database lookup to occurs, so from a template you must call the an alias like thispath('_page_alias_homepage')
The
PageController::catchAll
has been removed.Execute the following migrations
ALTER TABLE page__page ADD page_alias VARCHAR(255) DEFAULT NULL ALTER TABLE page__snapshot ADD page_alias VARCHAR(255) DEFAULT NULL
Add the CMF bundle into the AppKernel.php
new Symfony\Cmf\Bundle\RoutingExtraBundle\SymfonyCmfRoutingExtraBundle()
-
[BC BREAK] Change prototype of "PageExtension::url" method and so "sonata_page_url" Twig helper.
Before: sonata_page_url(page, absolute) After: sonata_page_url(page, {'param1': 'value1', ...}, absolute)
-
[BC BREAK] Block::$settings "name" property is now a "code" property.
Database Migration: (replace table name)
ALTER TABLE page__bloc ADD name VARCHAR(255) DEFAULT NULL;
Migration command: (change entity class as required)
php app/console sonata:page:migrate-block-name-setting --class="Application\Sonata\PageBundle\Entity\Block"
Optionally, set the --update-name parameter to true to update the "name" field with the old "name" setting.
php app/console sonata:page:migrate-block-name-setting --update-name=true
-
[BC BREAK] Mapped Block::$settings to doctrine JsonType (previously an ArrayType)
Add the new dependency sonata/doctrine-extensions :
php composer.phar update
Migration command :
php app/console sonata:page:migrate-block-json --table page__bloc php app/console sonata:page:migrate-block-json --table page__bloc_audit
-
Mapped Snapshot::$content to JsonType (previously a manually encoded json string)
-
[BC BREAK] The page bundle has now a dependency to the SonataNotificationBundle to run the snapshot task asynchronously.
Command changes :
app/console sonata:page:create-snapshots --site=all --mode=sync # default mode (BC) app/console sonata:page:create-snapshots --site=all --mode=async
-
[BC BREAK] prefix internal route to page_internal*, all internals routes must be renamed to include the correct prefix
SQL Update :
UPDATE `page__page` SET `route_name` = CONCAT('_page_internal_', route_name) WHERE url IS NULL AND route_name != 'cms_page' AND SUBSTR(route_name, 1, 14) <> '_page_internal' republish the snaphsot pages.
- Add SEO fields to Site and alter the SeoPage information
- [BC BREAK] DecoratorStrategy : Update regular expressions, regular expression separators are not fixed in the class.
- Add a twig global variable sonata_page (sonata_page.cmsmanager, sonata_page.siteavailables, sonata_page.currentsite)
- Add locale to Site model, if the locale is set an _locale attribute is set to the request and no site available for the current url, then the user is redirected to the default site a (ie, / => /en, if /en is the default)
-
[BC BREAK] Move cache and some block to the BlockBundle
Block names has been updated:
UPDATE `page__bloc` SET `type` = 'sonata.block.service.text' WHERE `type` = 'sonata.page.block.text'; UPDATE `page__bloc` SET `type` = 'sonata.block.service.action' WHERE `type` = 'sonata.page.block.action'; UPDATE `page__bloc` SET `type` = 'sonata.block.service.rss' WHERE `type` = 'sonata.page.block.rss'; republish the snaphsot pages.
-
[BC BREAK] Sonata\PageBundle\Block\BaseBlockService does not exist anymore.
use Sonata\BlockBundle\Block\BaseBlockService;
- [BC BREAK] Integrates the SeoBundle