diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index ea4d00f..2bfb936 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -510,8 +510,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b = $field_id = $instance['field_id']; $field_name = $instance['field_name']; $field = field_info_field_by_id($field_id); - $function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op; - if (function_exists($function)) { + if (function_exists($options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op)) { // Add the field to the list of fields to invoke the hook on. if (!isset($fields[$field_id])) { $fields[$field_id] = $field; @@ -543,6 +542,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b = // For each field, invoke the field hook and collect results. foreach ($fields as $field_id => $field) { $field_name = $field['field_name']; + $function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op; // Iterate over all the field translations. foreach ($grouped_items[$field_id] as $langcode => &$items) { $entities = $grouped_entities[$field_id][$langcode];