function ConfigInstaller::findDefaultConfigWithUnmetDependencies

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::findDefaultConfigWithUnmetDependencies()
  2. 8.9.x core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::findDefaultConfigWithUnmetDependencies()
  3. 10 core/lib/Drupal/Core/Config/ConfigInstaller.php \Drupal\Core\Config\ConfigInstaller::findDefaultConfigWithUnmetDependencies()

Finds default configuration with unmet dependencies.

Parameters

\Drupal\Core\Config\StorageInterface $storage: The storage containing the default configuration.

array $enabled_extensions: A list of all the currently enabled modules and themes.

\Drupal\Core\Config\StorageInterface[] $profile_storages: An array of storage interfaces containing profile configuration to check for overrides.

Return value

array An array containing:

  • A list of configuration that has unmet dependencies.
  • An array that will be filled with the missing dependency names, keyed by the dependents' names.
1 call to ConfigInstaller::findDefaultConfigWithUnmetDependencies()
ConfigInstaller::checkConfigurationToInstall in core/lib/Drupal/Core/Config/ConfigInstaller.php
Checks the configuration that will be installed for an extension.

File

core/lib/Drupal/Core/Config/ConfigInstaller.php, line 560

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

protected function findDefaultConfigWithUnmetDependencies(StorageInterface $storage, array $enabled_extensions, array $profile_storages = []) {
    $missing_dependencies = [];
    $config_to_create = $this->getConfigToCreate($storage, StorageInterface::DEFAULT_COLLECTION, '', $profile_storages);
    $all_config = array_merge($this->configFactory
        ->listAll(), array_keys($config_to_create));
    foreach ($config_to_create as $config_name => $config) {
        if ($missing = $this->getMissingDependencies($config_name, $config, $enabled_extensions, $all_config)) {
            $missing_dependencies[$config_name] = $missing;
        }
    }
    return [
        array_intersect_key($config_to_create, $missing_dependencies),
        $missing_dependencies,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.