symfony-docs
symfony-docs copied to clipboard
POST_SUBMIT_EVENT improvement?
Reading https://symfony.com/doc/current/form/events.html#c-the-formevents-post-submit-event, even if it's true that's clearly stated
It can be used to fetch data after denormalization.
it is, correctly, just an advice. No one prevents the user to set data directly on the underlying form object (after some logic applied, for example?).
This will result possibly in a validation happening before new data taking place as ValidationListener
has no priority declared (https://github.com/symfony/form/blob/master/Extension/Validator/EventListener/ValidationListener.php#L35).
Proposal
Warn explicitly the user, through the doc page, about this eventuality. If this makes sense to you, let me know and I'll make a PR.
PS.: I was wondering if ValidationListener
has the right behaviour: as long as form component can't prevent someone to modify data after validation (and that's not possible at all), ValidationListener
should be registered with PHP_MAX_INT
priority (minus 1, in order to let someone to act before data validation?) to take shelter of this kind of issues. I think it would be a good idea because, as this component is designed, validation is "automatically" done by component itself so, as long as validation is expected, why shouldn't we care when it actually happens?
It makes sense?
Did anyone had the chance to look at this?
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Still waiting for a feedback
@DonCallisto Please open a PR. We can discuss the proper wording there. :)
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Hello? This issue is about to be closed if nobody replies.
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!