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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lucashodge created an issue. See original summary.

lucashodge’s picture

The following patch stops addressfield_field_widget_form from wiping the address fields when the user submits the form.

lucashodge’s picture

Filename had a hidden space, re-attaching.

bojanz’s picture

To confirm, you're only seeing this issue when trying to use the widget without JS, right?

bember’s picture

I've experienced the same issue and #3 works great. Thanks @lucashodge!

bember’s picture

@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