8000 [Routing][4.1][BC Break] Controller names drop single colon notation · Issue #27522 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Routing][4.1][BC Break] Controller names drop single colon notation #27522
Closed
@Majkl578

Description

@Majkl578

Symfony version(s) affected: 4.1.0

Description
Route loader (DelegatingLoader) now always returns controllers with double-colon notation.
This breaks existing code that relies on the single-colon format.

How to reproduce
Have a controller referenced with single colons. Although the code affected is a custom route loader that generates such controller names, it shouldn't be directly needed to have one to reproduce.

Possible Solution
Revert the change for implicitly changing : to :::

$controller = str_replace(':', '::', $controller);

as commented here

Suggesting to keep the deprecation, but revert forced change from : to ::.

Additional context
The code affected performs different logic based on whether controller is single-colon or double-colon notation (in the _controller request attribute). Single colon is used for a controller that is registered as a DI service, double colon is used for non-registered controllers.
Although possibly unfortunate (dates back to SF 2.6), this has been working flawlessly until SF 4.1.

Introduced in #26085.

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

      0