1

I have see when i want to create a new route they have an limit of 15 routes per module. In fact i have created an over route an i'm suprise to see of my road wans in route:debug. However they are in the module.routing.yml

I have cout the number of routes i have , and after 15 the routes arren't seen.

It's me or it's normal?

The YAML file :

 //empty line is not comment on the code
 unicef42.unicef_controller_index:
   path: '/unicef42'
   defaults:
     _controller: '\Drupal\unicef42\Controller\UnicefController::world'
     _title: 'Unicef controller'
   requirements:
     _permission: 'access content'

 //...the other routes

 //The 15th routes , no comment in the real code,1 empty road between the 14th and the 15th routes
 unicef42.accueil_controller_index:
   path: '/accueil'
   defaults:
     _controller: '\Drupal\unicef42\Controller\AccueilController::index'
     _title: ''
   requirements:
     _permission: 'access content'

 //The 16th routes , no comment in the real code, 1 empty road between the 15th and the 16th routes
 unicef42.accueil_controller_index:
   path: '/accueil2'
   defaults:
     _controller: '\Drupal\unicef42\Controller\AccueilController::index'
     _title: ''
   requirements:
     _permission: 'access content'
 //empty line is not comment on the code
1

It's just you I'm afraid.

Take the system module's routing file for example; there are a few dozen routes in there, plenty more than 15.

Symfony doesn't impose any limits either, so I'd check that your YAML code is properly formatted and valid. If you're positive it's all good, you've probably hit a bug and the best course of action would be to report it.

1
  • My YAML is right, i will to report this bug. But where is the location to report bug? – Emilien Gallet Jan 29 '16 at 10:48
1

If you look at the content of the user.routing.yml file, you will notice there are more than 15 routes defined in that file.

What is wrong in your code is that the fifteenth and the sixteenth routes have the same identifier, unicef42.accueil_controller_index.

unicef42.accueil_controller_index:
  path: '/accueil'
  defaults:
    _controller: '\Drupal\unicef42\Controller\AccueilController::index'
    _title: ''
  requirements:
    _permission: 'access content'

unicef42.accueil_controller_index:
  path: '/accueil2'
  defaults:
    _controller: '\Drupal\unicef42\Controller\AccueilController::index'
    _title: ''
  requirements:
    _permission: 'access content'

That's the error in the definition of those routes, and why Drupal doesn't seem to see more than fifteen routes per module.

The User module, which defines two routes using the same path, but for two different HTTP methods and two different output formats, uses two different route IDs.

user.pass:
  path: '/user/password'
  defaults:
    _form: '\Drupal\user\Form\UserPasswordForm'
    _title: 'Reset your password'
  requirements:
    _access: 'TRUE'
  options:
    _maintenance_access: TRUE

user.pass.http:
  path: '/user/password'
  defaults:
    _controller: \Drupal\user\Controller\UserAuthenticationController::resetPassword
  methods: [POST]
  requirements:
    _access: 'TRUE'
    _format: 'json'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.