only in patch2: unchanged: --- a/core/includes/config.inc +++ b/core/includes/config.inc @@ -41,8 +41,10 @@ * @see \Drupal\Core\Config\ConfigInstaller */ function config_install_default_config($type, $name) { - // Get all default configuration owned by this extension. - $source_storage = new ExtensionInstallStorage(); + // Get all default configuration owned by this extension. During installation + // this should include config from the installation profile. During normal + // runtime the installation profile should be ignored. + $source_storage = new ExtensionInstallStorage(drupal_get_profile(), drupal_installation_attempted()); $config_to_install = $source_storage->listAll($name . '.'); // Work out if this extension provides default configuration for any other only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -16,6 +16,36 @@ class ExtensionInstallStorage extends InstallStorage { /** + * Include profile config directories + *. + * @var bool + */ + protected $includeProfile; + + /** + * The installation profile. + * + * @var string + */ + protected $profile; + + /** + * Constructs a new FileStorage controller. + * + * @param string $profile + * The name of the installation profile used on the site. + * @param bool $include_profile + * If TRUE, include default configuration from the installation profile's + * config directory. + * + * Overrides Drupal\Core\Config\FileStorage::__construct(). + */ + public function __construct($profile, $include_profile = FALSE) { + $this->includeProfile = $include_profile; + $this->profile = $profile; + } + + /** * Returns a map of all config object names and their folders. * * The list is based on enabled modules and themes. @@ -25,7 +55,13 @@ class ExtensionInstallStorage extends InstallStorage { */ protected function getAllFolders() { if (!isset($this->folders)) { - $this->folders = $this->getComponentNames('module', array_keys(\Drupal::moduleHandler()->getModuleList())); + $module_list = \Drupal::moduleHandler()->getModuleList(); + // Only include the profile module's config if $this->includeProfile is + // set to TRUE. + if (!$this->includeProfile && isset($module_list[$this->profile])) { + unset($module_list[$this->profile]); + } + $this->folders = $this->getComponentNames('module', array_keys($module_list)); $this->folders += $this->getComponentNames('theme', array_keys(array_filter(list_themes(), function ($theme) {return $theme->status;}))); } return $this->folders;