Bug #49042

own backend module routes not working in own Routes file

Added by Simon Schaufelberger about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:2013-06-12
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:-
Target version:-

Description

i guess this route here in neos package is a catcher for every route:

-
  name: 'Backend - Modules'
  uriPattern: 'neos/{module}'
  defaults:
    '@package':    'TYPO3.Neos'
    '@controller': 'Backend\Module'
    '@action':     'index'
    '@format':     'html'
  routeParts:
    module:
      handler: TYPO3\Neos\Routing\BackendModuleRoutePartHandler

its not possible to define a more granular route in an own Routes file. When i have my own route in the neos routes file, the route works. when i move it out into my own package, it doesnt work again.

History

#1 Updated by Bastian Waidelich about 2 years ago

  • Status changed from New to Needs Feedback
  • Assigned To set to Bastian Waidelich

Hey,

did you make sure your route is included before the neos sub routes? and are you sure that it matches correctly?

The route setup I posted to your thread should work, I just tested this. To verify include the following block to the top of your global Routes.yaml (in yourApp/Configuration/Routes.yaml) above the "TYPO3 Neos subroutes" block:

-
  name: 'Backend - User administration module'
  uriPattern: 'neos/administration/users/{moduleArguments.account}/{moduleArguments.@action}'
  defaults:
    '@package':    'TYPO3.Neos'
    '@controller': 'Backend\Module'
    '@action': 'index'
    'moduleArguments':
      '@package':    'typo3.neos'
      '@subpackage': ''
      '@controller': 'module\administration\users'
    'module':
      'module': 'administration/users'
      'controller': '\TYPO3\Neos\Controller\Module\Administration\UsersController'
      'action': 'index'
  routeParts:
    'moduleArguments.account':
      objectType: 'TYPO3\Flow\Security\Account'
      uriPattern: '{accountIdentifier}'

#2 Updated by Simon Schaufelberger about 2 years ago

did you make sure your route is included before the neos sub routes?

how can i test that?

and are you sure that it matches correctly?

yes, otherwise it would not work in the Packages/Application/TYPO3.NEOS/Configuration/Routes.yaml where i tested it.

aaaah, now i added it to (global) Configuration/Routes.yaml and there it works but it's NOT working in Packages/Application/MyApp/Configuration/Routes.yaml

What i want is to ship my own Routes for my own backend module so i need to add them to the Routes file in my own Package but since i cannot overwrite the neos routes there, i have a problem currently.

#3 Updated by Simon Schaufelberger about 2 years ago

If its just a loading order problem of the packages, what do you think about a sorting feature in neos to reorder the loading of the packages in the package manager? Or some configuration in the config yaml file like: load this package before another package.

#4 Updated by Bastian Waidelich about 2 years ago

  • Status changed from Needs Feedback to Closed

Simon Schaufelberger wrote:

did you make sure your route is included before the neos sub routes?

how can i test that?

For instance by executing following CLI command:

./flow routing:list

aaaah, now i added it to (global) Configuration/Routes.yaml and there it works but it's NOT working in Packages/Application/MyApp/Configuration/Routes.yaml

Package routes are not dependend on the package loading order as you have to include them manually. See http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/Routing.html#subroutes

The order of how you include those sub routes defines the priority of a route.

#5 Updated by Simon Schaufelberger about 2 years ago

ok i got the point but how is it then possible for a package provider to overwrite routes from the neos package? i don't want people to tell: please add these routes to your global routes file, the routes should be in the package routes included.

#6 Updated by Bastian Waidelich about 2 years ago

Simon Schaufelberger wrote:

ok i got the point but how is it then possible for a package provider to overwrite routes from the neos package?
i don't want people to tell: please add these routes to your global routes file, the routes should be in the package routes included.

Put it the other way around:
Would you want every package you install to change the public URIs of your project?

We plan to have a feature in the Neos or Flow "package manager" that prompts you if a package comes with custom routes (or other optional configuration), so that they can be activated with a click.

Also available in: Atom PDF