diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index 676b6ba..4035c86 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -208,7 +208,7 @@ route: label: 'Param' # Config dependencies. -config_dependencies_calculated: +config_dependencies_base: type: mapping mapping: entity: @@ -228,11 +228,11 @@ config_dependencies_calculated: - type: string config_dependencies: - type: config_dependencies_calculated + type: config_dependencies_base label: 'Configuration dependencies' mapping: fixed: - type: config_dependencies_calculated + type: config_dependencies_base label: 'Fixed configuration dependencies' config_entity: diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php index 84a0462..ba6d204 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php @@ -19,6 +19,27 @@ * handled in the correct order. For example, node types are created before * their fields, and both are created before the view display configuration. * + * The configuration dependency value is structured like so: + * + * array( + * 'config => array( + * // An array of configuration entity object names. + * ), + * 'module' => array( + * // An array of module names. + * ), + * 'theme' => array( + * // An array of theme names. + * ), + * 'fixed' => array( + * // An array of fixed configuration dependencies. + * 'config' => array(), + * 'module' => array(), + * 'theme' => array(), + * ), + * ); + * + * * If a configuration entity is provided as default configuration by an * extension (module, theme, or profile), the extension has to depend on any * modules or themes that the configuration depends on. For example, if a view @@ -28,7 +49,11 @@ * depend on a particular module that one of its default configuration entities * depends on, you can use a sub-module: move the configuration entity to the * sub-module instead of including it in the main extension, and declare the - * module dependency in the sub-module only. + * module dependency in the sub-module only. If the extension author wants the + * configuration to depend on something that is not calculable then they can add + * these dependencies to the fixed dependency key. For example, the forum module + * provides the forum node type and in order for it to be deleted when the forum + * module is uninstalled it has a fixed dependency on the module. * * Classes for configuration entities with dependencies normally extend * \Drupal\Core\Config\Entity\ConfigEntityBase or at least use @@ -37,11 +62,11 @@ * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * which should calculate (and return) the dependencies. In this method, use * \Drupal\Core\Config\Entity\ConfigEntityBase::addDependency() to add - * dependencies. Most implementations call + * dependencies. Implementations should call * \Drupal\Core\Config\Entity\ConfigEntityBase::calculateDependencies() since it * provides a generic implementation that will discover dependencies due to - * plugins and third party settings. To get a configuration entity's current - * dependencies without forcing a recalculation use + * fixed dependencies, plugins, and third party settings. To get a configuration + * entity's current dependencies without forcing a recalculation use * \Drupal\Core\Config\Entity\ConfigEntityInterface::getDependencies(). * * Classes for configurable plugins are a special case. They can either declare