diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 6a16969..8533b8c 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -529,16 +529,15 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie // deletions are already managed. break; } - + $dependencies_for_removal = [ + 'config' => [$entity], + 'content' => [], + 'module' => [], + 'theme' => [] + ]; // Fix or remove any dependencies. while ($dependents = \Drupal::service('config.manager')->findConfigEntityDependentsAsEntities('config', [$entity->getConfigDependencyName()])) { $dependent = reset($dependents); - $dependencies_for_removal = [ - 'config' => [$entity], - 'content' => [], - 'module' => [], - 'theme' => [] - ]; if ($dependent->onDependencyRemoval($dependencies_for_removal)) { $dependent->save(); } diff --git a/core/lib/Drupal/Core/Entity/EntityDeleteForm.php b/core/lib/Drupal/Core/Entity/EntityDeleteForm.php index 93c1c13..1bd9d8e 100644 --- a/core/lib/Drupal/Core/Entity/EntityDeleteForm.php +++ b/core/lib/Drupal/Core/Entity/EntityDeleteForm.php @@ -27,8 +27,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Only do dependency processing for configuration entities. Whilst it is // possible for a configuration entity to be dependent on a content entity, // these dependencies are soft and content delete permissions are often - // given to more users. The in this method should not make assumptions that - // $entity is a configuration entity in case we decide to change this later. + // given to more users. This method should not make assumptions that $entity + // is a configuration entity in case we decide to remove the following + // condition. if (!($entity instanceof ConfigEntityInterface)) { return $form; }