Problem/Motivation
When using the Select 2 boxes (Multiple values) widget on a form (in my case, node form) and you add/edit values to the field, if the form server side validation fails then the new values are not saved on the field.
Steps to reproduce
One simple way to reproduce is:
1. Create a dummy Content Type
2. Add a entity reference field to a taxonomy
3. Set the widget to "Select 2 boxes (Multiple values)"
4. Add a list string field or any field that can be displayed as radios, with at least 2 options and make it required
5. Set the widget to radios
6. Create a new node of the dummy Content Type
7. Do not select anything from the radios field (we want the validation to fail)
8. Add at least one value to the select 2 boxes field
9. Save the form and after the validation fails, you can see that the select 2 boxes field is empty, instead of containing the value that we set previously
Proposed resolution
Most probably there's a gap in the code, so debugging would be a good start.
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | form-validation-fix-3228646-2.patch | 629 bytes | u_tiwari |
Comments
Comment #2
u_tiwari commentedHere is a fix.
Comment #4
matsbla commentedThe patch solves the issue, great, thanks!
Comment #5
bbu23Thank you for the patch. I don't know why I didn't see it when you posted it.
For some reason, it still doesn't work for me. The values still disappear from the form if the validation fails. Is it just me or..? Can you please tell me if the version matters? I applied the patch on alpha3, I see that the latest release is alpha8. Thanks!
Comment #6
matsbla commentedUse last dev version