Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23575

An exception has been thrown during the rendering of a template Route 'ezpublish_ezdemo_search' not found

    Details

      Description

      If you create a new bundle to be able to create a new design, you'll get the following error

      An exception has been thrown during the rendering of a template ("None of the chained routers were able to generate route: Route 'ezpublish_ezdemo_search' not found") in eZDemoBundle::page_header_searchbox.html.twig at line 1. 
      

      • Create a new bundle
      • Edit the bundle main class and add

        public function getParent()
        {
        	return 'eZDemoBundle';
        }
        

      • Copy the demobundle pagelayout.html.twig and past it to the Resources/view folder
      • Clear the caches
      • Access to the frontpage, in "dev" mode

        Issue Links

          Activity

          Hide
          Joao Inacio (Inactive) added a comment -

          From http://symfony.com/doc/current/cookbook/bundles/override.html :

          Routing

          Routing is never automatically imported in Symfony2. If you want to include the routes from any bundle, then they must be manually imported from somewhere in your application (e.g. app/config/routing.yml).

          The easiest way to "override" a bundle's routing is to never import it at all. Instead of importing a third-party bundle's routing, simply copying that routing file into your application, modify it, and import it instead.

          So, the solution should be to (again) import the DemoBundle routes from Some\Custom\Bundle routing.yml:

          _ezpublishDemoRoutes:
              resource: "@eZDemoBundle/Resources/config/routing.yml"

          Show
          Joao Inacio (Inactive) added a comment - From http://symfony.com/doc/current/cookbook/bundles/override.html : Routing Routing is never automatically imported in Symfony2. If you want to include the routes from any bundle, then they must be manually imported from somewhere in your application (e.g. app/config/routing.yml). The easiest way to "override" a bundle's routing is to never import it at all. Instead of importing a third-party bundle's routing, simply copying that routing file into your application, modify it, and import it instead. So, the solution should be to (again) import the DemoBundle routes from Some\Custom\Bundle routing.yml: _ezpublishDemoRoutes: resource: "@eZDemoBundle/Resources/config/routing.yml"
          Hide
          Yannick Roger (Inactive) added a comment - - edited

          It is a symfony issue: https://github.com/symfony/symfony/issues/10335
          which links to a stackoverflow answer that is interesting: https://stackoverflow.com/questions/9373433/symfony2-bundle-inheritance-losing-parent-bundles-routes

          So the solution would be to either not use @myBundle and replace it with a relative path or, as Joao suggested, reimport the routing file, both of them being not very clean solutions

          Show
          Yannick Roger (Inactive) added a comment - - edited It is a symfony issue: https://github.com/symfony/symfony/issues/10335 which links to a stackoverflow answer that is interesting: https://stackoverflow.com/questions/9373433/symfony2-bundle-inheritance-losing-parent-bundles-routes So the solution would be to either not use @myBundle and replace it with a relative path or, as Joao suggested, reimport the routing file, both of them being not very clean solutions
          Show
          Yannick Roger (Inactive) added a comment - I added know limitation to: https://doc.ez.no/display/EZP/How+to+create+a+new+design+using+Bundle+Inheritance
          Hide
          Ricardo Correia (Inactive) added a comment -

          QA approved.

          Show
          Ricardo Correia (Inactive) added a comment - QA approved.

            People

            • Assignee:
              Unassigned
              Reporter:
              Pedro Resende (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: