You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #254 [Live] Re-extracting form data after submit (weaverryan)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Live] Re-extracting form data after submit
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| Tickets | Addresses part of #221
| License | MIT
This fixes 3 bugs at once:
1) This recalculates `formValues` after submit, in case the submitted data *changes* the form's data or underlying structure (e.g. `CollectionType`)
2) If a field is suddenly missing entirely from a form (hint: think removing an embedded CollectionType form), then previously `validatedFields` did not "forget" that field. This caused edge-case bug when removing an embedded form that was validated, then adding a new form a moment later (which would be empty, but now validated).
3) When passing a `FormView` into your component that was already validated, on the first re-render, the validation would be lost and only modified fields would be validated.
Ping `@Lustmored` and `@norkunas`. This mostly addresses `@norkunas`'s problems with how `getFormValues()` works, but this was also causing trouble for `@Lustmored`, potentially for different reasons. So, this may not solve the problems addressed in #221, but it's certainly related.
Cheers!
Commits
-------
c8b3a28 [Live] Re-extracting form data after submit
thrownew \LogicException('The submitForm() method is being called, but the FormView has already been built. Are you calling $this->getForm() - which creates the FormView - before submitting the form?');
0 commit comments