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.
In function addressfield_field_widget_form()
, an "entity key" is set. This is helpful, but it does not seem to work for some cases of use within Inline Entity Form and maybe in some other places where forms are loaded in via AJAX. So, to make it more specific, add the form parents to it and that seems to fix the issue for us:
$element_key = implode('|', array($element['#entity_type'], $element['#bundle'], $element['#field_name'], $element['#language'], $element['#delta'], implode('-', $element['#field_parents'])));
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedThis is fixed by #1662680: Stop duplicating form state values in $form_state['addressfield'].