Skip to content

Regression in matching the earliest route #27512

@pamil

Description

@pamil

Symfony version(s) affected: 4.1.0

Description & how to reproduce
Having the following routing defined:

sylius_admin_product_variant_bulk_delete:
    path: /bulk-delete
    methods: [DELETE]
    defaults:
        _controller: sylius.controller.product_variant:bulkDeleteAction
        _sylius: ["sylius specific config..."]

sylius_admin_product_variant_delete:
    path: /{id}
    methods: [DELETE]
    defaults:
        _controller: sylius.controller.product_variant:deleteAction
        _sylius: ["sylius specific config..."]

After upgrading from the most recent 4.0.x to 4.1.0, the router started to match the second route for a DELETE /bulk-delete request, treating bulk-delete as {id}. As mentioned in https://symfony.com/doc/current/routing/requirements.html, the earliest route should be matched.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions