Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: lucashodge at Media Insights commentedThe following patch stops addressfield_field_widget_form from wiping the address fields when the user submits the form.
Comment #3
lucashodge CreditAttribution: lucashodge at Media Insights commentedFilename had a hidden space, re-attaching.
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedTo confirm, you're only seeing this issue when trying to use the widget without JS, right?
Comment #5
bember CreditAttribution: bember at Giant Rabbit, LLC commentedI've experienced the same issue and #3 works great. Thanks @lucashodge!
Comment #6
bember CreditAttribution: bember at Giant Rabbit, LLC 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