-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Wrong description of normalized data in FormEvents::SUBMIT #11193
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
Comments
I'd say this is rather related to your code then as both events will actually receive the submitted data but not the initial data. |
Whereas the data received via the event is the submitted data, this is not true for the data retrieved from the form. We have prepared a minimal working example. If you use this type and submit a change from "initial_data" to "request_data" you will receive the following output: FormEvents::PRE_SUBMIT
FormEvents::SUBMIT
FormEvents::POSTSUBMIT
From my understanding this corresponds to the implementation in Form.php as the norm data of the form is updated just before dispatching |
That's the expected behaviour. From your initial description I thought you were talking about the |
Sorry for being ambiguous in this point. I am referring to the following description (screenshot from the docs): I believe this to document |
@xabbuh Could you be so kind and have another look at this issue? It's about the normalized data in the submit event (example and description in previous comments). |
@sb-relaxt-at This looks indeed confusing. Though I have no idea how we could improve this. |
Thank you for this issue. |
Hello? This issue is about to be closed if nobody replies. |
I created PR #18934 which update documentation |
There seems to be an error in the documentation about form events. Given our limited testing we see the following behaviour in Symfony 4.2:
FormEvents::SUBMIT / Normalized data
This contains the same data as in
FormEvents::POST_SET_DATA
(so it is yet not updated) - whereas the docs say "Data from the request reverse-transformed from the request using a view transformer" (which indicates that this contains the new value from the request).FormEvents::POST_SUBMIT / Normalized data
As a subsequent error the description of FormEvents::POST_SUBMIT ("Same as in FormEvents::SUBMIT") is wrong, as it contains the data from the request.
The text was updated successfully, but these errors were encountered: