Commit ca21c4b9 authored by catch's avatar catch
Browse files

Issue #2343517 by joelpittet, quietone, rteijeiro, andypost: Cleanup @todo...

Issue #2343517 by joelpittet, quietone, rteijeiro, andypost: Cleanup @todo referring to the config dependencies API issue

(cherry picked from commit c26a85ea)
parent 2ea9f648
...@@ -81,14 +81,6 @@ function field_purge_batch($batch_size, $field_storage_unique_id = NULL) { ...@@ -81,14 +81,6 @@ function field_purge_batch($batch_size, $field_storage_unique_id = NULL) {
foreach ($fields as $field) { foreach ($fields as $field) {
$entity_type = $field->getTargetEntityTypeId(); $entity_type = $field->getTargetEntityTypeId();
// We cannot purge anything if the entity type is unknown (e.g. the
// providing module was uninstalled).
// @todo Revisit after https://www.drupal.org/node/2080823.
if (!isset($info[$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 = \Drupal::entityTypeManager()->getStorage($entity_type)->purgeFieldData($field, $batch_size); $count_purged = \Drupal::entityTypeManager()->getStorage($entity_type)->purgeFieldData($field, $batch_size);
if ($count_purged < $batch_size || $count_purged == 0) { if ($count_purged < $batch_size || $count_purged == 0) {
// No field data remains for the field, so we can remove it. // No field data remains for the field, so we can remove it.
...@@ -108,13 +100,6 @@ function field_purge_batch($batch_size, $field_storage_unique_id = NULL) { ...@@ -108,13 +100,6 @@ function field_purge_batch($batch_size, $field_storage_unique_id = NULL) {
continue; continue;
} }
// We cannot purge anything if the entity type is unknown (e.g. the
// providing module was uninstalled).
// @todo Revisit after https://www.drupal.org/node/2080823.
if (!isset($info[$field_storage->getTargetEntityTypeId()])) {
continue;
}
$fields = $deleted_fields_repository->getFieldDefinitions($field_storage->getUniqueStorageIdentifier()); $fields = $deleted_fields_repository->getFieldDefinitions($field_storage->getUniqueStorageIdentifier());
if (empty($fields)) { if (empty($fields)) {
field_purge_field_storage($field_storage); field_purge_field_storage($field_storage);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment