Skip to content
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

Fix route loading in Contao 4.13 #379

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Fix route loading in Contao 4.13 #379

merged 6 commits into from
Nov 26, 2024

Conversation

aschempp
Copy link
Member

To stay compatible with Contao 4.13/Symfony 5, you cannot use attributes for route loading (since they were added in Symfony 6). But the annotation still works in Symfony 6 and 7.

Copy link
Collaborator

@fritzmg fritzmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the annotation still works in Symfony 6 and 7.

It won't work in Symfony 7, will it?

@aschempp
Copy link
Member Author

@fritzmg
Copy link
Collaborator

fritzmg commented Nov 26, 2024

Have you confirmed this works locally? It does not work for me in Contao 5.4 with Symfony 7.

There is no Annotation loader in Symfony 7 anymore (by default).

Copy link
Collaborator

@fritzmg fritzmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR the following error occurs under Contao 5.4 with Symfony 7:

bin/console debug:router nc_bulky_item_download
13:02:49 CRITICAL  [console] Error thrown while running command "debug:router nc_bulky_item_download". Message: "The route "nc_bulky_item_download" does not exist."

@fritzmg
Copy link
Collaborator

fritzmg commented Nov 26, 2024

It will: https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Routing/Annotation/Route.php#L14

As far as I can see this is just there to re-use the FQCN of the old @Route annotation for the attribute.

@aschempp
Copy link
Member Author

Fixed in 80b942d

@aschempp aschempp added the bug label Nov 26, 2024
@Toflar Toflar closed this Nov 26, 2024
@Toflar Toflar reopened this Nov 26, 2024
@Toflar Toflar merged commit d3dccef into main Nov 26, 2024
24 of 26 checks passed
@Toflar Toflar deleted the fix/attribute branch November 26, 2024 15:34
@fritzmg
Copy link
Collaborator

fritzmg commented Nov 26, 2024

This made me realize I had the same issue in inspiredminds/contao-event-registration and fixed it there accordingly 😁

@Toflar
Copy link
Member

Toflar commented Nov 26, 2024

Yeah, looking forward to Contao 4.13 EOL in February 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants