Having observed similar behavior as in #2390719 with two Entityform blocks with addressfields in each, I found out that the hook_field_widget_form() implementation does not check the form ID of the submitted values and will thus fill all addressfields that happen to be on the same page with those values.

The check for existing input here should check for form ID just as the Form API does:

if ($form_state['programmed'] || (!empty($form_state['input']) && (isset($form_state['input']['form_id']) && ($form_state['input']['form_id'] == $form_state['build_info']['form_id']))))

instead of just checking for

if (!empty($form_state['input']))

Comments

jensschuppe created an issue. See original summary.

jensschuppe’s picture

jensschuppe’s picture

Status: Active » Needs review