diff --git a/core/modules/field/field.deprecated.inc b/core/modules/field/field.deprecated.inc index 2c9340c..589a6e5 100644 --- a/core/modules/field/field.deprecated.inc +++ b/core/modules/field/field.deprecated.inc @@ -159,7 +159,7 @@ function field_info_formatter_settings($type) { /** * Returns a lightweight map of fields across bundles. * - * The function only returns non deleted fields. + * The function only returns non-deleted fields. * * @return * An array keyed by entity type. Each value is an array which keys are @@ -194,8 +194,7 @@ function field_info_field_map() { * The entity type. * @param $field_name * The name of the field to retrieve. $field_name can only refer to a - * non-deleted field. For deleted fields, use - * field_info_field_by_id(). + * non-deleted field. For deleted fields, use field_info_field_by_id(). * * @return * The field array, as returned by field_read_fields(), with an @@ -356,12 +355,12 @@ function field_read_field($entity_type, $field_name, $include_additional = array * Reads in fields that match an array of conditions. * * @param array $conditions - * An array of conditions to match against. Keys are names of properties found - * in field configuration files, and values are conditions to match. + * An array of conditions to match against. Keys are names of properties + * found in field configuration files, and values are conditions to match. * @param array $include_additional - * The default behavior of this function is to not return fields that are - * have been deleted. Setting - * $include_additional['include_deleted'] to TRUE will override this behavior. + * The default behavior of this function is to not return fields that have + * been deleted. Setting $include_additional['include_deleted'] to TRUE will + * override this behavior. * * @return * An array of fields matching $params. If @@ -396,9 +395,9 @@ function field_read_fields($conditions = array(), $include_additional = array()) * @param $bundle * The bundle to which the field is bound. * @param array $include_additional - * The default behavior of this function is to not return an instance that has - * been deleted. Setting - * $include_additional['include_deleted'] to TRUE will override this behavior. + * The default behavior of this function is to not return an instance that + * has been deleted. Setting $include_additional['include_deleted'] to TRUE + * will override this behavior. * * @return * An instance structure, or FALSE. diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php index 8d03386..3b23ecc 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php @@ -243,9 +243,6 @@ public function __construct(array $values, $entity_type = 'field_instance') { elseif (isset($values['field_uuid'])) { $field = field_info_field_by_id($values['field_uuid']); if (!$field) { - $field = current(field_read_fields(array('uuid' => $values['field_uuid']), array('include_deleted' => TRUE))); - } - if (!$field) { throw new FieldException(format_string('Attempt to create an instance of unknown field @uuid', array('@uuid' => $values['field_uuid']))); } }