diff --git a/entityreference_prepopulate.module b/entityreference_prepopulate.module index 8a67fa0..7d26868 100644 --- a/entityreference_prepopulate.module +++ b/entityreference_prepopulate.module @@ -80,6 +80,10 @@ function entityreference_prepopulate_field_attach_form($entity_type, $entity, &$ foreach (element_children($form_state['field']) as $field_name) { foreach ($form_state['field'][$field_name] as $lang => $value) { + if (!isset($value['instance'])) { + continue; + } + $instance = $value['instance']; if (empty($instance['settings']['behaviors']['prepopulate']['status'])) { continue;