diff --git a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Tables.php b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Tables.php index 09c8fda..78885e9 100644 --- a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Tables.php +++ b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Tables.php @@ -76,6 +76,7 @@ function addField($field, $type, $langcode) { // system. $propertyDefinitions = array(); $entity_info = entity_get_info($entity_type); + $field_map = field_info_field_map(); for ($key = 0; $key <= $count; $key ++) { // If there is revision support and only the current revision is being // queried then use the revision id. Otherwise, the entity id will do. @@ -98,10 +99,11 @@ function addField($field, $type, $langcode) { // Normally it is a field name, but field_purge_batch() is passing in // id:$field_id so check that first. if (substr($specifier, 0, 3) == 'id:') { - $field = field_info_field_by_id(substr($specifier, 3)); + $short_specifier = substr($specifier, 3); + $field = isset($field_map[$short_specifier]) ? field_info_field_by_id(substr($short_specifier, 3)) : FALSE; } else { - $field = field_info_field($specifier); + $field = isset($field_map[$specifier]) ? field_info_field($specifier) : FALSE; } // If we managed to retrieve the field, process it. if ($field) {