diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
index b943d17..aa19456 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Config\ConfigException;
 use Drupal\Core\Config\Schema\SchemaIncompleteException;
 use Drupal\Core\Entity\Entity;
 use Drupal\Core\Config\ConfigDuplicateUUIDException;
@@ -419,6 +420,7 @@ public function getConfigDependencyName() {
    * {@inheritdoc}
    */
   public function onDependencyRemoval(array $dependencies) {
+    return FALSE;
   }
 
   /**
@@ -441,4 +443,27 @@ protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_typ
     Cache::invalidateTags($entity_type->getListCacheTags());
   }
 
+  public static function preDelete(EntityStorageInterface $storage, array $entities) {
+    foreach ($entities as $entity) {
+      $dependents = \Drupal::service('config.manager')->findConfigEntityDependentsAsEntities('config', [$entity->getConfigDependencyName()]);
+      if (!empty($dependents)) {
+        // Maybe the dependents can fix themselves.
+        $dependents = array_filter($dependents, function ($dependent) use ($entity) {
+          return !$dependent->onDependencyRemoval(['config' => [$entity]]);
+        });
+        if (!empty($dependents)) {
+          $dependents_list = array_map(function ($dependent) {
+            return $dependent->getConfigDependencyName();
+          }, $dependents);
+          throw new ConfigException(String::format('Can not delete @name since @dependents depend on it', [
+            '@name' => $entity->getConfigDependencyName(),
+            '@dependents' => implode($dependents_list, ', ')
+          ]));
+        }
+      }
+    }
+    parent::preDelete($storage, $entities);
+  }
+
+
 }
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
index 15347e3..82de43e 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
@@ -170,6 +170,9 @@ public function calculateDependencies();
    *   An array of dependencies that will be deleted keyed by dependency type.
    *   Dependency types are, for example, entity, module and theme.
    *
+   * @return bool
+   *   TRUE if the entity has been changed as a result, FALSE if not.
+   *
    * @see \Drupal\Core\Config\Entity\ConfigDependencyManager
    * @see \Drupal\Core\Config\ConfigManager::uninstall()
    * @see \Drupal\Core\Entity\EntityDisplayBase::onDependencyRemoval()
diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index aba35e2..9bafe89 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
@@ -410,6 +410,7 @@ public function onDependencyRemoval(array $dependencies) {
     if ($changed) {
       $this->save();
     }
+    return $changed;
   }
 
   /**
diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php
index e27fc16..c5e0617 100644
--- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php
+++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php
@@ -136,6 +136,7 @@ public function onDependencyRemoval(array $dependencies) {
     if ($changed) {
       $this->save();
     }
+    return $changed;
   }
 
   /**
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index dc4643a..036c730 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -413,6 +413,7 @@ public function onDependencyRemoval(array $dependencies) {
     if ($changed) {
       $this->save();
     }
+    return $changed;
   }
 
   /**
