A user is unable to submit the address form when changing to a non-default country. The addressfield_field_widget_form callback wipes the values on an AJAX change of the form but also wipes the form and then silently fails on an actual form submission.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | addressfield-validation-issue-with-country-change-2908128-2.patch | 691 bytes | lucashodge |
Comments
Comment #2
lucashodge commentedThe following patch stops addressfield_field_widget_form from wiping the address fields when the user submits the form.
Comment #3
lucashodge commentedFilename had a hidden space, re-attaching.
Comment #4
bojanz commentedTo confirm, you're only seeing this issue when trying to use the widget without JS, right?
Comment #5
bember commentedI've experienced the same issue and #3 works great. Thanks @lucashodge!
Comment #6
bember commented@lucashodge it turns out that my issue was caused by using a form_alter hook to change a country default value. It is recommended to use hook_addressfield_default_values_alter() instead. I wonder if that's your case too.
For further details: https://www.drupal.org/project/addressfield/issues/2392855