eZ Platform Discussions

Upgrade to 2.3 admin not loading: "No route found for "GET /admin""


#1

I have just upgraded ez from 1.9 -> 2.3.

All is looking great on the site with the exception of the admin, it will not load.

Symfony\Component\HttpKernel\Exception\NotFoundHttpException

in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ RouterListener.php (line 139)

The ezplatform yaml file:

# services, this replaces the services yml from symfony
services:
    app.twig_extension:
        class: AppBundle\Twig\AppExtension
        tags:
        - { name: twig.extension }
        arguments:
        - '@ezpublish.api.repository'
        - '@ezpublish.translation_helper'
    app.pre_content_view_listener:
        class: AppBundle\EventListener\PreContentViewListener
        tags:
        - {name: kernel.event_listener, event: ezpublish.pre_content_view, method: onPreContentView}
        arguments:
        - '@ezpublish.api.repository'
        - '@ezpublish.templating.global_helper'
    app.content_types:
        class: AppBundle\Service\ContentTypes
        arguments:
        - '@ezpublish.api.inner_repository'
        - '@ezpublish.api.service.content_type'
ezpublish:
    # HttpCache settings, By default 'local' (Symfony HttpCache Proxy), by setting it to 'http' you can point it to Varnish
    http_cache:
        purge_type: '%purge_type%'
    # Repositories configuration, setup default repository to support solr if enabled
    repositories:
        default:
            storage: ~
            search:
                engine: '%search_engine%'
                connection: default

    # Siteaccess configuration, with one siteaccess per default
    siteaccess:
        default_siteaccess: de
        list:
        - de
        - en
        - admin
        groups:
            site_group:
            - de
            - en
            # WARNING: Do not remove or rename this group.
            # It's used to distinguish common siteaccesses from admin ones.
            # In case of multisite with multiple admin panels, remember to add any additional admin siteaccess to this group.
            admin_group: [admin]
        match:
            Compound\LogicalAnd:
                en:
                    matchers:
                        Map\URI: { en: true }
                        Map\Host: { '%site_domain%': true }
                    match: en
            Map\Host:
                '%site_domain%': de

    # System settings, grouped by siteaccess and/or siteaccess group
    system:
        site_group:
            api_keys: { google_maps: "AIzaSyAQxS8BllcoYZwzrtBbwc8jk_qz2kTZYpo" }
            # Cache pool service, needs to be different per repository (database) on multi repository install.
            cache_service_name: '%cache_pool%'
            # These reflect the current installers, complete installation before you change them. For changing var_dir
            # it is recommended to install clean, then change setting before you start adding binary content, otherwise you'll
            # need to manually modify your database data to reflect this to avoid exceptions.
            var_dir: var/site
            # System languages. Note that by default, content, content types, and other data are in eng-GB locale,
            # so removing eng-GB from this list may lead to errors or content not being shown, unless you change
            # all eng-GB data to other locales first.
            content:
                # As we by default enable EzSystemsPlatformHttpCacheBundle which is designed to expire all affected cache
                # on changes, and as error / redirects now have separate ttl, we easier allow ttl to be greatly increased
                default_ttl: '%httpcache_default_ttl%'
            # HttpCache purge server(s) setting, eg Varnish, for when ezpublish.http_cache.purge_type is set to 'http'.
            http_cache:
                purge_servers: ['%purge_server%']
        # WARNING: Do not remove or rename this group.
        admin_group:
            cache_service_name: '%cache_pool%'
            var_dir: var/site
            languages: [eng-GB]
            content:
                default_ttl: '%httpcache_default_ttl%'
            http_cache:
                purge_servers: ['%purge_server%']
        de:
            languages: [ger-DE, eng-GB]
        en:
            languages: [eng-GB]
        default:
            content:
                tree_root:
                    # This feature is a reimplementation of the PathPrefix one that existed in eZ Publish Legacy.
                    location_id: 54
                    # Every URL aliases starting with those prefixes will be considered
                    # being outside of the subtree starting at root_location.
                    # Default value is an empty array.
                    # Prefixes are not case sensitive.
                    excluded_uri_prefixes: [ /media, /images ]
            user:
                layout: pagelayout.html.twig
            image_variations:
                full_size:
                    reference: null
                    filters:
                    - { name: geometry/scalewidthdownonly, params: [1500] }
                social_share_facebook:
                    reference: null #social_share_fb
                    filters:
                    - { name: geometry/scaledownonly, params: [500, 300] }
            content_view:
                full:
                    root_folder:
                        template: "full/home_page.html.twig"
                        match:
                            Identifier\ContentType: "home_page"

                    article_container:
                        controller: "AppBundle:ArticleContainer:articleContainerChildren"
                        match:
                            Identifier\ContentType: "article_container"

                    # Example use of the src/AppBundle/QueryType files
                    #                        params:
                    #                            query:
                    #                                query_type: 'LocationChildren'
                    #                                parameters:
                    #                                    parentLocationId: "@=location.id"
                    #                                assign_results_to: 'items'

                    article:
                        template: "full/article.html.twig"
                        match:
                            Identifier\ContentType: "article"
                    simple_page:
                        template: "full/simple_page.html.twig"
                        match:
                            Identifier\ContentType: "simple_page"
                    blog_container:
                        controller: "AppBundle:BlogContainer:blogContainerChildren"
                        template: "full/blog_container.html.twig"
                        match:
                            Identifier\ContentType: "blog_container"
                    blog_article:
                        template: "full/blog_article.html.twig"
                        match:
                            Identifier\ContentType: "blog_article"
                embed:
                    module:
                        template: "embed/module.html.twig"
                        match:
                            Identifier\ContentType: "module"
                    quote:
                        template: "embed/quote.html.twig"
                        match:
                            Identifier\ContentType: "quote"
                    article:
                        template: "embed/article.html.twig"
                        match:
                            Identifier\ContentType: "article"
                    article_container:
                        template: "embed/article_container.html.twig"
                        match:
                            Identifier\ContentType: "article_container"
                    blog_container:
                        template: "embed/blog_container.html.twig"
                        match:
                            Identifier\ContentType: "blog_container"
                line:
                    article:
                        template: "line/article.html.twig"
                        match:
                            Identifier\ContentType: "article"
                    blog_article:
                        template: "line/blog_article.html.twig"
                        match:
                            Identifier\ContentType: "blog_article"
    url_alias:
        slug_converter:
            transformation: 'urlalias_lowercase'

ez_platform_standard_design:
    # makes Kernel default templates (in EzPublishCoreBundle/Resources/views) part of standard Design
    override_kernel_templates: true

liip_imagine:
    filter_sets:

        # the name of the "filter set"
        social_share_fb:

            # adjust the image quality to 75%
            quality: 75

            # list of transformations to apply (the "filters")
            filters:

                # create a thumbnail: set size to 120x90 and use the "outbound" mode
                # to crop the image when the size ratio of the input differs
                thumbnail:
                    size: [120, 90]
                    mode: outbound  # crop the input image, if required

                # create a 2px black border: center the thumbnail on a black background
                # 4px larger to create a 2px border around the final image
                # background: { size: [124, 94], position: center, color: '#000000' }

I am far from an expert with the admin setup of ez. Does anyone know what could be wrong?

I followed the official update explatform guide to get to where I am.


Site access specific services
#2

It looks like you’re missing Admin UI routes in your routing.yml file:

ezplatform.admin_ui:
    resource: '@EzPlatformAdminUiBundle/Resources/config/routing.yml'
    defaults:
        siteaccess_group_whitelist: '%admin_group_name%'

#3

No i can see this attribute in the routing yaml file :confused:

I am going to try and install a fresh install with my existing database and see what that does.


#4

Hmm, it seems all was ok except the siteaccess.match section. As soon as I changed it to what is delivered in the stock yml file:

# Siteaccess configuration, with one siteaccess per default
siteaccess:
    list: [de, en, admin]
    groups:
        site_group: [de, en]

        # WARNING: Do not remove or rename this group.
        # It's used to distinguish common siteaccesses from admin ones.
        # In case of multisite with multiple admin panels, remember to add any additional admin siteaccess to this group.
        admin_group: [admin]
    default_siteaccess: de
    match:
        URIElement: 1

The all worked :confused:

We are also moving this /<lang> from the url as we are moving to use the url tdl’s instead, ie .com and .de.


#5

In addition, the content overrides we previously had in the “default” section were overriding the views in the admin.

To fix this, we had to move the content overrides to the site_group