Skip to content

[LiveComponent] Fix #[LiveProp(writable: true, url: true)] that was not updated as a query parameter #2976

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
Aug 7, 2025

Conversation

mbuliard
Copy link
Contributor

@mbuliard mbuliard commented Aug 5, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #2960 Fix #2975
License MIT

Hi,
The LiveUrl feature in 2.28 introduced a few bugs and I would like to fix some :

@mbuliard mbuliard force-pushed the 2.x branch 2 times, most recently from 699e256 to 8bd0702 Compare August 5, 2025 21:38
@mbuliard mbuliard changed the title [LiveComponent] Fix LiveUrl [LiveComponent] Fix LiveUrl bugs Aug 6, 2025
@mbuliard mbuliard marked this pull request as ready for review August 6, 2025 06:58
@carsonbot carsonbot added Bug Bug Fix LiveComponent Status: Needs Review Needs to be reviewed labels Aug 6, 2025
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, that's much appreciated! :)

Is the modified test enough to cover issue #2975, or should we add a dedicated one?

Also please, can you update your PR's title to something more relevant? Thanks!

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Aug 6, 2025
@mbuliard mbuliard force-pushed the 2.x branch 2 times, most recently from ac904f4 to c054fb8 Compare August 6, 2025 20:59
@mbuliard mbuliard changed the title [LiveComponent] Fix LiveUrl bugs [LiveComponent] Fix LiveUrlFactory MethodNotAllowedException Aug 6, 2025
@mbuliard
Copy link
Contributor Author

mbuliard commented Aug 6, 2025

Thanks for working on this, that's much appreciated! :)

Is the modified test enough to cover issue #2975, or should we add a dedicated one?

Also please, can you update your PR's title to something more relevant? Thanks!

@Kocal
I would have prefered to help for the fixes sooner but I was on vacation, without computer. :-/

I edited the fixtures of functional tests to reproduce the bug. Previously the route was accepting all methods and the problem was not detected.

I am confident that the issue #2975 is the same as the previous #2960 but the exception is caught by the hotfix #2961 and no new url is returned.

@Kocal
Copy link
Member

Kocal commented Aug 7, 2025

So should we remove the MethodNotAllowedException from catch()?

@mbuliard
Copy link
Contributor Author

mbuliard commented Aug 7, 2025

So should we remove the MethodNotAllowedException from catch()?

I think the exception should not happen, but since the $previousUrl comes from user-land, anything can enter, including a url matching a POST route, which would throw the exception. I would keep catching it, just in case.

@Kocal
Copy link
Member

Kocal commented Aug 7, 2025

I confirm it fixes #2975, thanks!

@Kocal Kocal changed the title [LiveComponent] Fix LiveUrlFactory MethodNotAllowedException [LiveComponent] Fix #[LiveProp(writable: true, url: true)] that was not updated as a query parameter Aug 7, 2025
@Kocal Kocal changed the title [LiveComponent] Fix #[LiveProp(writable: true, url: true)] that was not updated as a query parameter [LiveComponent] Fix #[LiveProp(writable: true, url: true)] that was not updated as a query parameter Aug 7, 2025
@Kocal
Copy link
Member

Kocal commented Aug 7, 2025

Thank you @mbuliard.

@Kocal Kocal merged commit 9d1560c into symfony:2.x Aug 7, 2025
25 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to 2.28 breaks live-props as url [LiveComponent] 500 errors with MethodNotAllowedException on dev after 2.28 upgrade
3 participants