-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing][4.1][BC Break] Controller names drop single colon notation #27522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
but that detection is already wrong in 3.4 and 4.0: if your service is registered as a service using its FQCN as id, you could already use the double colon in 3.4 and 4.0, but the service would still be used. thus, if we consider this change a BC break, it would also mean that we can never add any new feature in the controller syntax, as any logic assuming the old rules would break when using the new feature. |
This is not a safe assumption. Even since SF 3.3, double colon could be used for controllers as services under some circumstances. This is why we deprecated the single column syntax. |
As you can see, it was working perfectly fine until 4.1.0. Maybe because no other bundles (Rest, Twig etc.) were used, but it was working flawlessly.
Well you can, in major version for sure. But breaking bundles in minor versions is unfortunate.
Agreed, as I said, this is coming from days of SF 2.6.
I totally agree with that, it has always been confusing.
Yes: 4.x should throw deprecation (as it does), but it should still work until 5.0, otherise the BC promise is broken. :/ |
Anyone willing to try a fix? |
See #27566 |
… notation (dmaicher) This PR was merged into the 4.1 branch. Discussion ---------- [FrameworkBundle] fix for allowing single colon controller notation | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27522 | License | MIT | Doc PR | - This fixes a BC break introduced in #26085 (review). ping @Tobion Commits ------- 1680674 [FrameworkBundle] fix for allowing single colon controller notation
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::
: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.
The text was updated successfully, but these errors were encountered: