--- field-FieldUninstallValidator-2871486-4.patch 2019-11-29 13:26:12.744307521 +0400 +++ 2871486-18.patch 2019-11-29 13:34:13.652331472 +0400 @@ -1,8 +1,8 @@ diff --git a/core/modules/field/src/FieldUninstallValidator.php b/core/modules/field/src/FieldUninstallValidator.php -index 6ee521e002..672de82908 100644 +index b4666f3..0d8b0cf 100644 --- a/core/modules/field/src/FieldUninstallValidator.php +++ b/core/modules/field/src/FieldUninstallValidator.php -@@ -53,11 +53,22 @@ public function validate($module) { +@@ -53,11 +53,21 @@ public function validate($module) { if ($field_storages = $this->getFieldStoragesByModule($module)) { // Provide an explanation message (only mention pending deletions if there // remain no actual, non-deleted fields.) @@ -11,15 +11,14 @@ foreach ($field_storages as $field_storage) { - if (!$field_storage->isDeleted()) { - $fields_in_use[$field_storage->getType()][] = $field_storage->getLabel(); -+ if($field_storage->isDeleted()) { ++ if ($field_storage->isDeleted()) { + $hasDeleted = TRUE; + continue; } -+ + // Check if the field storage has a dependency enforcement by the module + // and therefore should be deleted + $dependencies = $field_storage->get('dependencies'); -+ if(isset($dependencies['enforced']['module']) && in_array($module, $dependencies['enforced']['module'])) { ++ if (isset($dependencies['enforced']['module']) && in_array($module, $dependencies['enforced']['module'])) { + continue; + } + @@ -27,18 +26,12 @@ } if (!empty($fields_in_use)) { foreach ($fields_in_use as $field_type => $field_storages) { -@@ -65,13 +76,12 @@ public function validate($module) { +@@ -65,7 +75,7 @@ public function validate($module) { $reasons[] = $this->formatPlural(count($fields_in_use[$field_type]), 'The %field_type_label field type is used in the following field: @fields', 'The %field_type_label field type is used in the following fields: @fields', ['%field_type_label' => $field_type_label, '@fields' => implode(', ', $field_storages)]); } } - else { -+ else if($hasDeleted){ ++ else if ($hasDeleted) { $reasons[] = $this->t('Fields pending deletion'); } } - return $reasons; - } -- - /** - * Returns all field storages for a specified module. - *