diff -u b/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php --- b/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -186,21 +186,21 @@ */ public function uninstall($type, $name) { // Remove all dependent configuration entities. - $dependent_entities = $this->findConfigEntityDependentsAsEntities($type, array($name)); + $extension_dependent_entities = $this->findConfigEntityDependentsAsEntities($type, array($name)); // Give config entities a chance to become independent of the entities we // are going to delete. - foreach (array_reverse($dependent_entities) as $entity) { - $entity_dependency_ids = $entity->calculateDependencies()['entity']; - if (empty($entity_dependency_ids)) { + foreach (array_reverse($extension_dependent_entities) as $entity) { + $entity_dependencies = $entity->calculateDependencies(); + if (empty($entity_dependencies) || empty($entity_dependencies['entity'])) { // No dependent entities nothing to do. continue; } // Work out if any of the entity's dependencies are going to be affected // by the uninstall. $affected_entity_dependencies = array(); - foreach ($dependent_entities as $entity) { - if (in_array($entity->id(), $entity_dependency_ids)) { + foreach ($extension_dependent_entities as $entity) { + if (in_array($entity->id(), $entity_dependencies['entity'])) { $affected_entity_dependencies[] = $entity; } } @@ -211,12 +211,11 @@ // Recalculate the dependencies, some config entities may have fixed their // dependencies on the to-be-removed entities. - $dependent_entities = $this->findConfigEntityDependentsAsEntities($type, array($name)); - + $extension_dependent_entities = $this->findConfigEntityDependentsAsEntities($type, array($name)); // Reverse the array to that entities are removed in the correct order of // dependence. For example, this ensures that field instances are removed // before fields. - foreach (array_reverse($dependent_entities) as $entity) { + foreach (array_reverse($extension_dependent_entities) as $entity) { $entity->setUninstalling(TRUE); $entity->delete(); } diff -u b/core/modules/config/src/Tests/ConfigDependencyTest.php b/core/modules/config/src/Tests/ConfigDependencyTest.php --- b/core/modules/config/src/Tests/ConfigDependencyTest.php +++ b/core/modules/config/src/Tests/ConfigDependencyTest.php @@ -201,7 +201,6 @@ $entity2 = $storage->load('entity2'); $this->assertTrue($entity2, 'Entity 2 not deleted'); $this->assertEqual($entity2->calculateDependencies()['entity'], array(), 'Entity 2 dependencies updated to remove dependency on Entity1.'); - } /** only in patch2: unchanged: --- a/core/modules/system/src/Form/ModulesUninstallConfirmForm.php +++ b/core/modules/system/src/Form/ModulesUninstallConfirmForm.php @@ -146,8 +146,8 @@ public function buildForm(array $form, array &$form_state) { $form['entities'] = array( '#type' => 'details', - '#title' => $this->t('Configuration deletions'), - '#description' => $this->t('The listed configuration will be deleted.'), + '#title' => $this->t('Affected configuration'), + '#description' => $this->t('The listed configuration will be updated, if possible, or deleted.'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#access' => FALSE,