diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php index ef49b65..52875bb 100644 --- a/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -417,7 +417,7 @@ public function getConfigCollectionInfo() { * TRUE if the entity has changed as a result of calling the * onDependencyRemoval() method, FALSE if not. */ - protected function callOnDependencyResolver($operation, ConfigEntityInterface $entity, array $dependent_entities, $type, array $names) { + protected function callOnDependencyResolver($operation, ConfigEntityInterface $entity, array $dependent_entities, $type, array $names) { $entity_dependencies = $entity->getDependencies(); if (empty($entity_dependencies)) { // No dependent entities nothing to do. diff --git a/core/lib/Drupal/Core/Config/ConfigManagerDependencyFinderInterface.php b/core/lib/Drupal/Core/Config/ConfigManagerDependencyFinderInterface.php index 34e1cf8..f6f49f2 100644 --- a/core/lib/Drupal/Core/Config/ConfigManagerDependencyFinderInterface.php +++ b/core/lib/Drupal/Core/Config/ConfigManagerDependencyFinderInterface.php @@ -43,8 +43,8 @@ * order of the deletes is significant and must be processed in the returned * order. * - * @todo Move this method in \Drupal\Core\Config\ConfigManagerDependencyFinderInterface - * in Drupal 9.0.x. + * @todo Move this method in \Drupal\Core\Config\ConfigManagerInterface in + * Drupal 9.0.x. */ public function getConfigEntitiesToChange($operation, $type, array $names, $dry_run = TRUE); diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 5424dda..cf1e83d 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -593,7 +593,7 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie break; } // Fix or remove any dependencies. - $config_entities = static::getConfigManager()->getConfigEntitiesToChangeOnDependencyRemoval('config', [$entity->getConfigDependencyName()]); + $config_entities = static::getConfigManager()->getConfigEntitiesToChangeOnDependencyRemoval('config', [$entity->getConfigDependencyName()], FALSE); /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $dependent_entity */ foreach ($config_entities['update'] as $dependent_entity) { $dependent_entity->save(); diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityDependencyResolverInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityDependencyResolverInterface.php index 5dd7f16..45a7bef 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityDependencyResolverInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityDependencyResolverInterface.php @@ -7,6 +7,13 @@ namespace Drupal\Core\Config\Entity; +/** + * Provides an interface for configuration entities allowing them to update when + * their dependencies are changing. + * + * @todo Remove this interface in Drupal 9.0.x and move its methods in + * \Drupal\Core\Config\Entity\ConfigEntityInterface. + */ interface ConfigEntityDependencyResolverInterface { /** @@ -23,13 +30,19 @@ * * @param array $dependencies * An array of dependencies that will be changed keyed by dependency type. - * Dependency types are: 'module', 'theme', 'config', 'content'. + * Dependency types are: 'module', 'theme', 'config', 'content'. Each type + * is an array keyed by dependency name. If the type is 'module' or 'theme', + * the values are module or theme names. In the case of 'config' or + * 'content' each array value is the full dependency entity. * * @return bool * TRUE if the entity has changed, FALSE if not. * * @see \Drupal\Core\Config\Entity\ConfigDependencyManager * @see \Drupal\Core\Config\ConfigEntityBase::preSave() + * + * @todo Move this method in \Drupal\Core\Config\Entity\ConfigEntityInterface + * in Drupal 9.0.x. */ public function onDependencyUpdating(array $dependencies); @@ -37,7 +50,7 @@ public function onDependencyUpdating(array $dependencies); * Sets or removes the 'dependency_resolved' flag. * * This method is used during the dependency resolving process to signal if a - * config entuty has been just resolved. + * config entity has been resolved. * * @param bool $resolved * TRUE if the entity dependencies were resolved. @@ -45,18 +58,27 @@ public function onDependencyUpdating(array $dependencies); * @return \Drupal\Core\Config\Entity\ConfigEntityInterface * Returns the entity for chaining purposes. * - * @see \Drupal\Core\Config\ConfigManagerInterface + * @see \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChange() + * @see \Drupal\Core\Config\ConfigManager::callOnDependencyResolver() + * + * @todo Move this method in \Drupal\Core\Config\Entity\ConfigEntityInterface + * in Drupal 9.0.x. */ public function setDependencyResolved($resolved); /** - * Returns if an entity has been resolved. + * Returns if an dependency entity has been resolved. * * Tells the configuration dependency system that a config entity has been * just resolved. * * @return bool * TRUE if the entity dependency has been resolved. + * + * @see \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChange() + * + * @todo Move this method in \Drupal\Core\Config\Entity\ConfigEntityInterface + * in Drupal 9.0.x. */ public function isDependencyResolved();