Skip to content

[Routing] Fix localized paths #40767

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

Merged
merged 1 commit into from
May 2, 2021
Merged

Conversation

l-vo
Copy link
Contributor

@l-vo l-vo commented Apr 11, 2021

Q A
Branch? 5.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

Related to #40266, localized paths does not work anymore. This PR aims to fix that and add a rework on the tests (using real annotations/attributes instead of guessing the parsing that may lead to errors).

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

@l-vo l-vo force-pushed the fix_localized_paths branch from 58ca2b4 to 1e20cd6 Compare April 11, 2021 10:04
@l-vo l-vo marked this pull request as ready for review April 11, 2021 10:04
@carsonbot carsonbot changed the title WIP [Routing] Fix localized paths [Routing] WIP Fix localized paths Apr 11, 2021
@l-vo l-vo force-pushed the fix_localized_paths branch from 1e20cd6 to 67fd37f Compare April 11, 2021 10:07
@l-vo l-vo changed the title [Routing] WIP Fix localized paths [Routing] Fix localized paths Apr 11, 2021
@nicolas-grekas nicolas-grekas modified the milestones: 4.4, 5.x Apr 11, 2021
@nicolas-grekas nicolas-grekas requested a review from derrabus April 11, 2021 12:40
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Good catch, thank you for your PR!

}

/**
* @Route({"requirements":{"locale":"en"}, "path":""})
Copy link
Member

Choose a reason for hiding this comment

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

Okay, right. This does work now that we've enabled @NamedArgumentConstructor, but I'd consider this to be an accident rather than intended behavior. I would not build a test case for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

related to https://github.com/symfony/symfony/pull/40767/files#r612721813. This fixture is to test deprecation but maybe I misunderstand the target of the deprecation.

Copy link
Member

@derrabus derrabus Apr 13, 2021

Choose a reason for hiding this comment

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

The deprecation is not supposed to be triggered by normal annotation usage. The target are manual constructor calls (that should not happen anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh ok thank you. I pushed some changes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I used cs fixer with a wrong PHP version;it broke attributes. I'll fix it tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated :)

@l-vo l-vo force-pushed the fix_localized_paths branch 4 times, most recently from d061b3d to ec47816 Compare April 13, 2021 21:28
@l-vo l-vo force-pushed the fix_localized_paths branch from 4b97084 to 9bf4a24 Compare April 14, 2021 07:00
@l-vo
Copy link
Contributor Author

l-vo commented Apr 14, 2021

status: needs review

@derrabus derrabus modified the milestones: 5.x, 5.3 Apr 20, 2021
@COil
Copy link
Contributor

COil commented May 2, 2021

Hello, is there something to check related to this issue? I saw it wasn't shipped with 5.3 beta2.

@derrabus
Copy link
Member

derrabus commented May 2, 2021

IIRC, we're only waiting for a second core team approval.

Copy link
Contributor

@Tobion Tobion left a comment

Choose a reason for hiding this comment

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

The fix seems fine. But I think the deprecation in #40266 is not complete.

@derrabus
Copy link
Member

derrabus commented May 2, 2021

Thank you @l-vo.

@derrabus derrabus merged commit 21e3738 into symfony:5.x May 2, 2021
@fabpot fabpot mentioned this pull request May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants