Skip to content

Router order issue with v7 #95

Closed

Description

@bobvandevijver

Due to the new router loader, the route is now always placed at the end of the route collection. There is no way to influence its priority (which looks to be a limitation of the routing.route_loader tag), which means that when you have a catch all in your own routing, the endroid route can no longer be matched.

---------------------------------------------------------- -------- -------- ----------------------
 Name                                                       Method   Scheme   Path                                                               
---------------------------------------------------------- -------- -------- ----------------------
 ...
 routed_404                                                 ANY      https    /{slug}                                                            
 qr_code_generate                                           ANY      ANY      /2fa/qr/{builder}/{data}  
---------------------------------------------------------- -------- -------- ----------------------

As the original routing file is also removed, it is also not possible to disable the the route_enabled option to include it manually.

My recommendation would be to restore the original YAML file, and load that in the RouteLoader as per example in the Symfony documentation. That way, both methods remain available for consumers, without adding the overhead of maintaining two methods.

Another option would be to expose the third option of RouteCollection->add, which is the priority option. Unfortunately setting priority does not seem to be possible in a project routes.php (so I could lower the routed_404 prio).

Activity

  1. bobvandevijver commented on Oct 13, 2026

    @bobvandevijver
    Author

    For my project I've now solved this by disabling the route loading completely and using the qr_code_data_uri twig function instead.

  2. endroid commented on Oct 13, 2026

    @endroid
    Owner

    Fixed in 7.0.2 via #96. Set endroid_qr_code.route_priority: 1 (or above your catch-all priority) so the QR route matches first. The default remains 0 to preserve existing behavior. If switching back from the data-URI workaround, also re-enable route_enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions