-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 values no longer available in custom form elements #156
Comments
Do you think that's related to #149 ? |
...or maybe #155 ? |
Reverting #149 makes it work again. |
@cvette could you provide a minimal scenario (or maybe even a breaking test) that demonstrates expected vs actual behavior? |
@cvette If you lack the time you could maybe provide a short code snippet or at least some context: i.e. were you creating a custom form element? what behavior did you expect, etc.? Cheers :) |
It's a custom password confirmation form element, i.e. it checks whether the current value matches the value of another field and adds a validation error, if necessary. Yes, there are better ways to do that. The issue with this change is, that the values are now assigned after all form element onSubmit() methods are invoked. Previously, they were assigned within the same for-loop, therefore you had at least the values for all elements before the current one. So my implementation relies on the order of form elements, which is a bit fragile per se. |
Thanks for the explanation. I can reproduce the issue and added steps to reproduce to the issue description. |
Any new ideas here? Have also issues now, with conditional required fields based on values of other fields. |
@dlubitz I'm still looking for ways around this. Could you share some of your code? |
@bwaidelich Works very well. Thank you. |
It used to be possible to get the form values in
AbstractFormElement::onSubmit()
. But$formRuntime->getFormState()->getFormValues()
is empty since version 5.3.0.Steps to reproduce
$formRuntime->getFormState()->getFormValues()
inonSubmit
Expected result
Actual result
Affected versions
neos/form 5.3.0
The text was updated successfully, but these errors were encountered: