-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fix assigning data in PostSetDataEvent
and PostSubmitEvent
#53381
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
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
Sorry, something went wrong.
All reactions
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.
Sorry, something went wrong.
All reactions
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.');
Sorry, something went wrong.
All reactions
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 😅
Sorry, something went wrong.
All reactions
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 👍
Sorry, something went wrong.
All reactions
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
Sorry, something went wrong.
All reactions
-
👍 1 reaction
PostSetDataEvent
and PostSubmitEvent
Thank you @fancyweb. |
All reactions
Sorry, something went wrong.
nicolas-grekas
OskarStark
xabbuh
yceruto
Successfully merging this pull request may close these issues.
Ref #51043 where we changed the behavior on 6.4 since we don't assign the data property anymore.
cc @HeahDude