Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Latest commit

 

History

History
155 lines (130 loc) · 4.22 KB

UPGRADE-2.0.md

File metadata and controls

155 lines (130 loc) · 4.22 KB

Upgrade from 1.4 to 2.0

SonataAdmin Support

  • The Admin extensions where moved into symfony-cmf/sonata-admin-integration-bundle. With the move, the admin extension service names also changed. If you are using one of the routing extensions, you need to adjust your configuration.

    Before:

         # app/config/config.yml
      
         sonata_admin:
             extensions:
                 cmf_routing.admin_extension.route_referrers:
                      implements:
                          - Symfony\Cmf\Component\Routing\RouteReferrersInterface
                 cmf_core.admin_extension.publish_workflow.time_period:
                      implements:
                          - Symfony\Cmf\Component\Routing\RouteReferrersReadInterface

    After:

         # app/config/config.yml
                 
         sonata_admin:
             extensions:
                  cmf_sonata_admin_integration.routing.extension.route_referrers:
                      implements:
                          - Symfony\Cmf\Component\Routing\RouteReferrersInterface
                  cmf_sonata_admin_integration.routing.extension.frontend_link:
                      implements:
                          - Symfony\Cmf\Component\Routing\RouteReferrersReadInterface

    Admin service names also changed. If you are using the admin, you need to adjust your configuration, i.e. in the sonata dashboard:

    Before:

         # app/config/config.yml
         sonata_admin:
             dashboard:
                groups:
                    content:
                        label: URLs
                        icon: '<i class="fa fa-file-text-o"></i>'
                        items:
                            - cmf_routing.route_admin
                            - cmf_routing.redirect_route_admin

    After:

         # app/config/config.yml
         sonata_admin:
            dashboard:
                groups:
                    content:
                        label: URLs
                        icon: '<i class="fa fa-file-text-o"></i>'
                        items:
                            - cmf_sonata_admin_integration.routing.route_admin
                            - cmf_sonata_admin_integration.routing.redirect_route_admin

Route Model

  • Removed getAddFormatPattern()/setAddFormatPattern() from the model Route and getAddTrailingSlash()/setAddTrailingSlash() from the PHPCR Route. Use getOption()/setOption() with 'add_format_pattern' or 'add_trailing_slash' instead.

    Before

    $route->setAddFormatPattern(true);
    $route->setAddTrailingSlash(true);
    
    if ($route->getAddFormatPattern() || $route->getAddTrailingSlash()) {
        // ...
    }

    After

    $route->setOption('add_format_pattern', true);
    $route->setOption('add_trailing_slash', true);
    
    if ($route->getOption('add_format_pattern') || $route->getOption('add_trailing_slash')) {
        // ...
    }
  • Removed getParent()/setParent() from PHPCR Route and RedirectRoute. Use getParentDocument()/setParentDocument() instead.

    Before

    $route = new Route();
    $route->setParent($routeRoot);

    After

    $route = new Route();
    $route->setParentDocument($routeRoot);

Configuration

  • Removed the route_basepath setting, use route_basepaths instead.

    Before

    cmf_routing:
        # ...
        dynamic:
            persistence:
                phpcr:
                    route_basepath: '/cms/routes'
    <config xmlns="http://cmf.symfony.com/schema/dic/routing">
        <dynamic>
            <persistence>
                <phpcr route-basepath="/cms/routes" />
            </persistence>
        </dynamic>
    </config>

    After

    cmf_routing:
        # ...
        dynamic:
            persistence:
                phpcr:
                    route_basepaths: ['/cms/routes']
    <config xmlns="http://cmf.symfony.com/schema/dic/routing">
        <dynamic>
            <persistence>
                <phpcr>
                    <route-basepath>/cms/routes</route-basepath>
                </phpcr>
            </persistence>
        </dynamic>
    </config>