diff --git a/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php b/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php index 6f8fc20..b6fe2f1 100644 --- a/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php +++ b/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php @@ -41,6 +41,7 @@ public function __construct(EntityManagerInterface $entity_manager, TranslationI public function validate($module_name) { $reasons = array(); + if ($module_name != 'field') { foreach ($this->entityManager->getDefinitions() as $entity_type_id => $entity_type) { // We skip entity types defined by the module as there must be no content // to be able to uninstall them anyway. We also skip the Field module as @@ -48,7 +49,7 @@ public function validate($module_name) { // See \Drupal\Core\Entity\ContentUninstallValidator. if ($entity_type->getProvider() != $module_name && $entity_type->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) { foreach ($this->entityManager->getFieldStorageDefinitions($entity_type_id) as $storage_definition) { - if ($module_name != 'field' && $storage_definition->getProvider() == $module_name) { + if ($storage_definition->getProvider() == $module_name) { $storage = $this->entityManager->getStorage($entity_type_id); if ($storage instanceof FieldableEntityStorageInterface && $storage->countFieldData($storage_definition, TRUE)) { $reasons[] = $this->t('There is content for the field @field-name on entity type @entity_type.', array( @@ -60,6 +61,7 @@ public function validate($module_name) { } } } + } return $reasons; }