Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling#21379
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr commentedJan 23, 2017
We could still deprecate this feature in 3.3 as it's inconsistent with other loaders, properly defining attributes is always better IMHO. |
linaori commentedJan 23, 2017
Can you add a test-case with the What to do about the feature regarding defaults?
|
chalasr commentedJan 23, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
IMHO it should be removed, at least not kept as is, switching between two config formats for routing should not break an app.
Sure! |
stof commentedJan 23, 2017
Removing it makes sense, but it must be done using a deprecation first (so deprecated in 3.3 and removed in 4.0) |
33e78ce tode10ea6Comparechalasr commentedJan 23, 2017
Functional test added. Hope the fix is good, it was not that easy 😄 Status: needs review |
fabpot commentedJan 23, 2017
Not sure we should deprecate the feature, I think it's a nice one. |
chalasr commentedJan 23, 2017
I can understand. I'll look at adding it to other formats on 3.3 if you agree |
| use Symfony\Component\HttpFoundation\Response; | ||
| use Symfony\Component\Routing\Annotation\Route; | ||
| class AnnotatedController extends ContainerAware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It doesn't need the container.
de10ea6 toe3eb006Comparee3eb006 to1d298f0Comparechalasr commentedJan 24, 2017
Build failure is normal (high deps only). |
fabpot commentedJan 24, 2017
Thank you@chalasr. |
… attributes handling (chalasr)This PR was merged into the 2.7 branch.Discussion----------[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |77289b9#commitcomment-20572462| License | MIT| Doc PR | n/aThis fixes a BC break introduced in#21333. Instead of removing the automatic request attributes creation, we keep it but only for attributes that are mandatory (i.e. present in the route path).Thanks to@iltar for the idea.Commits-------1d298f0 [Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
fabpot commentedFeb 1, 2017
This is still a BC break as demonstrated by the tests of FrameworkExtraBundle:https://travis-ci.org/sensiolabs/SensioFrameworkExtraBundle/jobs/197153674 @chalasr Can you have a look at this? |
linaori commentedFeb 1, 2017
/** * @Route("/simple/multiple/{a}/{b}/") * @Template("@Foo/Simple/some.html.twig") */publicfunctionsomeMoreAction($a,$b,$c ='c') { } expectation is |
chalasr commentedFeb 1, 2017
I'll look into it. |
chalasr commentedFeb 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Reproduced on our test case in 2.7 and 3.3 (master...chalasr:reproduce-sensioextra-test) all is fine for argument resolving. The bottleneck seems to be in the |
chalasr commentedFeb 1, 2017
This PR was merged into the 3.0 branch.Discussion----------Fix default vars resolution for Template annotationFixes broken `@Template` default vars resolution which was relying on a buggy behaviorfixedsymfony/symfony#21379 (the annotation class loader no longer sets request attributes for any argument that has a default value, but only for ones which may be expected in the route path).Commits-------9ddf58a Fix default vars resolution for Template annotation
Uh oh!
There was an error while loading.Please reload this page.
This fixes a BC break introduced in#21333. Instead of removing the automatic request attributes creation, we keep it but only for attributes that are mandatory (i.e. present in the route path).
Thanks to@iltar for the idea.