diff --git a/core/modules/field/field.purge.inc b/core/modules/field/field.purge.inc index c12a3c56b5..49b5464ca1 100644 --- a/core/modules/field/field.purge.inc +++ b/core/modules/field/field.purge.inc @@ -82,19 +82,19 @@ function field_purge_batch($batch_size, $field_storage_uuid = NULL) { } $fields = entity_load_multiple_by_properties('field_config', $properties); - $entity_manager = \Drupal::entityTypeManager(); - $info = $entity_manager->getDefinitions(); + $entity_type_manager = \Drupal::entityTypeManager(); + $info = $entity_type_manager->getDefinitions(); foreach ($fields as $field) { $entity_type = $field->getTargetEntityTypeId(); // We cannot purge anything if the entity type is unknown (e.g. the // providing module was uninstalled). if (!isset($info[$entity_type])) { - \Drupal::logger('field')->warning("Cannot remove field because the entity type is unknown: %entity_type", ['%entity_type' => $entity_type]); + \Drupal::logger('field')->warning("Cannot remove field @field_name because the entity type is unknown: %entity_type", ['@field_name' => $field->getName(), '%entity_type' => $entity_type]); continue; } - $count_purged = $entity_manager->getStorage($entity_type)->purgeFieldData($field, $batch_size); + $count_purged = $entity_type_manager->getStorage($entity_type)->purgeFieldData($field, $batch_size); if ($count_purged < $batch_size || $count_purged == 0) { // No field data remains for the field, so we can remove it. field_purge_field($field);