Skip to content
Snippets Groups Projects
Commit 5f38198e authored by catch's avatar catch
Browse files

Revert "Issue #2195957 by Wim Leers, alexpott: Fixed Only install profile...

Revert "Issue #2195957 by Wim Leers, alexpott: Fixed Only install profile configuration when installing that profile, not when enabling associated modules."

This reverts commit 5ab43b6a.
parent 5ab43b6a
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\ConfigDependencyManager;
use Drupal\Core\Site\Settings;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class ConfigInstaller implements ConfigInstallerInterface {
......@@ -106,16 +105,8 @@ public function installDefaultConfig($type, $name) {
// Read enabled extensions directly from configuration to avoid circular
// dependencies with ModuleHandler and ThemeHandler.
$extension_config = $this->configFactory->get('core.extension');
$modules = (array) $extension_config->get('module');
// Unless we are installing the profile, remove it from the list.
if ($install_profile = Settings::get('install_profile')) {
if ($name !== $install_profile) {
unset($modules[$install_profile]);
}
}
$enabled_extensions = array_keys($modules);
$enabled_extensions = array_keys((array) $extension_config->get('module'));
$enabled_extensions += array_keys((array) $extension_config->get('theme'));
// Core can provide configuration.
$enabled_extensions[] = 'core';
......@@ -293,9 +284,8 @@ public function resetSourceStorage() {
public function getSourceStorage($collection = StorageInterface::DEFAULT_COLLECTION) {
if (!isset($this->sourceStorage)) {
// Default to using the ExtensionInstallStorage which searches extension's
// config directories for default configuration. Only include the profile
// configuration during Drupal installation.
$this->sourceStorage = new ExtensionInstallStorage($this->activeStorage, InstallStorage::CONFIG_INSTALL_DIRECTORY, $collection, drupal_installation_attempted());
// config directories for default configuration.
$this->sourceStorage = new ExtensionInstallStorage($this->activeStorage, InstallStorage::CONFIG_INSTALL_DIRECTORY, $collection);
}
if ($this->sourceStorage->getCollectionName() != $collection) {
$this->sourceStorage = $this->sourceStorage->createCollection($collection);
......
......@@ -7,8 +7,6 @@
namespace Drupal\Core\Config;
use Drupal\Core\Site\Settings;
/**
* Storage to access configuration and schema in enabled extensions.
*
......@@ -24,13 +22,6 @@ class ExtensionInstallStorage extends InstallStorage {
*/
protected $configStorage;
/**
* Flag to include the profile in the list of enabled modules.
*
* @var bool
*/
protected $includeProfile = TRUE;
/**
* Overrides \Drupal\Core\Config\InstallStorage::__construct().
*
......@@ -43,15 +34,11 @@ class ExtensionInstallStorage extends InstallStorage {
* @param string $collection
* (optional) The collection to store configuration in. Defaults to the
* default collection.
* @param bool $include_profile
* (optional) Whether to include the install profile in extensions to
* search.
*/
public function __construct(StorageInterface $config_storage, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE) {
public function __construct(StorageInterface $config_storage, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION) {
$this->configStorage = $config_storage;
$this->directory = $directory;
$this->collection = $collection;
$this->includeProfile = $include_profile;
}
/**
......@@ -84,13 +71,7 @@ protected function getAllFolders() {
$extensions = $this->configStorage->read('core.extension');
if (!empty($extensions['module'])) {
$modules = $extensions['module'];
if (!$this->includeProfile) {
if ($install_profile = Settings::get('install_profile')) {
unset($modules[$install_profile]);
}
}
$this->folders += $this->getComponentNames('module', array_keys($modules));
$this->folders += $this->getComponentNames('module', array_keys($extensions['module']));
}
if (!empty($extensions['theme'])) {
$this->folders += $this->getComponentNames('theme', array_keys($extensions['theme']));
......
......@@ -100,18 +100,6 @@ function testStandard() {
$config = $factory->get($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}
// Ensure that configuration from the Standard profile is not reused when
// enabling a module again since it contains configuration that can not be
// installed. For example, editor.editor.basic_html is editor configuration
// that depends on the ckeditor module. The ckeditor module can not be
// installed before the editor module since it depends on the editor module.
// The installer does not have this limitation since it ensures that all of
// the install profiles dependencies are installed before creating the
// editor configuration.
\Drupal::moduleHandler()->uninstall(array('editor', 'ckeditor'));
$this->rebuildContainer();
\Drupal::moduleHandler()->install(array('editor'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment