Skip to content

[Routing] BC break on the annotated route loading #25436

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

Closed
mRoca opened this issue Dec 11, 2017 · 6 comments
Closed

[Routing] BC break on the annotated route loading #25436

mRoca opened this issue Dec 11, 2017 · 6 comments

Comments

@mRoca
Copy link
Contributor

mRoca commented Dec 11, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.3.14

Hello, while updating a 3.3.13 project to 3.3.14, I've an issue with the following routing declaration:

my_route:
    resource: 'Foo\BarBundle\Controller\UserController'
    type: annotation
    prefix: /

The error is :

FileLocatorFileNotFoundException
The file "Foo\BarBundle\Controller\UserController" does not exist (in: /srv/app/app/config, /srv/app/app, /srv/app/app/Resources) in Foo\BarBundle\Controller\UserController (which is being imported from "/srv/app/app/config/routing.yml"). Make sure annotations are enabled.

The problem :
The AnnotatedRouteControllerLoader is called after the AnnotationDirectoryLoader one, and both can support the (string, 'annotation') routing entry.

It seems it's caused by the merge of #25113 in the 3.3 branch. This problem can be fixed by sensiolabs/SensioFrameworkExtraBundle#537 , but the commit is only available for the 5.1.3 SensioFrameworkExtraBundle version, whereas the 3.3 symfony branch only requires "sensio/framework-extra-bundle": "^3.0.2".

Another PR, the #25231 one, can fix the problem but has been rejected in favor of the SensioFrameworkExtraBundle one.

@xabbuh
Copy link
Member

xabbuh commented Dec 11, 2017

Can't you update to SensioFrameworkExtraBundle 5?

@mRoca
Copy link
Contributor Author

mRoca commented Dec 11, 2017

I can also update my routing file by using the resource: '@FooBarBundle/Controller/UserController.php' format, and it's what I did : it works without problem.

I've created the issue to track the bug : indeed we can also update to SensioFrameworkExtraBundle 5, but as there are at least 2 bc breaks between the 3 and the 5 version, there is still a potential bc break problem for other sf3.3 users.

@xabbuh
Copy link
Member

xabbuh commented Dec 11, 2017

I am not completely sure how @fabpot wants to handle releases for FrameworkExtraBundle before 5. But IMO that would be the only way to entirely fix it.

@fabpot
Copy link
Member

fabpot commented Dec 11, 2017

I'm more than willing to merge a pull request that would fix version 3 and 4 of FrameworkExtraBundle.

@dmaicher
Copy link
Contributor

@fabpot I created a PR for backporting the fix from 5 to 3: sensiolabs/SensioFrameworkExtraBundle#543

There seems to be no branch for version 4 though?

fabpot added a commit to sensiolabs/SensioFrameworkExtraBundle that referenced this issue Dec 14, 2017
This PR was merged into the 3.0 branch.

Discussion
----------

fix order in which route loaders are tried

Backport of #537 to fix symfony/symfony#25436

Commits
-------

caacb5e fix order in which route loaders are tried
@fabpot
Copy link
Member

fabpot commented Dec 14, 2017

v3.0.29 is out with the fix. Version 4.0 is not supported as it was a short-lived version, so one should jump from 3 to 5 directly.

@fabpot fabpot closed this as completed Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants