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
[Form] Fix assigning data in PostSetDataEvent
and PostSubmitEvent
#53381
Conversation
@@ -11,7 +11,6 @@ | |||
|
|||
namespace Symfony\Component\Form\Event; | |||
|
|||
use Symfony\Component\Form\Exception\BadMethodCallException; |
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.
should IMO be added back
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's not present in PostSubmitEvent.
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's not present in PostSubmitEvent.
No, but this is about PostSetDataEvent
and it is in the comment for the next major:
// throw new BadMethodCallException('Form data cannot be changed during "form.post_set_data", you should use "form.pre_set_data" instead.');
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.
What I mean is that there's the same code in PostSubmitEvent without the import 😅
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.
Oh I would add the import then 👍
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.
I'd follow what fabbot wants on this one, because this will come up again otherwise.
But we should then be careful when merging up to not remove the use
in 7.0
PostSetDataEvent
and PostSubmitEvent
Thank you @fancyweb. |
Ref #51043 where we changed the behavior on 6.4 since we don't assign the data property anymore.
cc @HeahDude