diff --git a/core/config/install/core.extension.yml b/core/config/install/core.extension.yml index ce74bae..659446c 100644 --- a/core/config/install/core.extension.yml +++ b/core/config/install/core.extension.yml @@ -1,2 +1,3 @@ module: {} theme: {} +profile: '' diff --git a/core/config/schema/core.extension.schema.yml b/core/config/schema/core.extension.schema.yml index bdc84b9..087e2e3 100644 --- a/core/config/schema/core.extension.schema.yml +++ b/core/config/schema/core.extension.schema.yml @@ -14,3 +14,6 @@ core.extension: sequence: type: integer label: 'Weight' + profile: + type: string + label: 'Install profile' diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 2d1765c..6e9636f 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -2197,12 +2197,6 @@ function install_write_profile($install_state) { // The user will have chosen. } - // Ensure to also store the installation profile in configuration for later - // use. - \Drupal::configFactory()->getEditable('core.extension') - ->set('profile', $install_state['parameters']['profile']) - ->save(); - if ($settings_value == '' && $distribution && !is_writable(\Drupal::service('site.path') . '/settings.php')) { $need_to_write = FALSE; } diff --git a/core/includes/install.inc b/core/includes/install.inc index 22067c6..6a4070c 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -621,6 +621,12 @@ function drupal_install_system($install_state) { // Install base system configuration. \Drupal::service('config.installer')->installDefaultConfig('core', 'core'); + // Ensure to also store the installation profile in configuration for later + // use. + \Drupal::configFactory()->getEditable('core.extension') + ->set('profile', $install_state['parameters']['profile']) + ->save(); + // Install System module and rebuild the newly available routes. $kernel->getContainer()->get('module_installer')->install(array('system'), FALSE); \Drupal::service('router.builder')->rebuild(); diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php index e18c63b..96e1e38 100644 --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -51,7 +51,7 @@ class ExtensionInstallStorage extends InstallStorage { * (optional) Whether to include the install profile in extensions to * search and to get overrides from. */ - public function __construct(StorageInterface $config_storage, $profile, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE) { + public function __construct(StorageInterface $config_storage, $profile, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE) { parent::__construct($directory, $collection); $this->configStorage = $config_storage; diff --git a/core/modules/system/system.install b/core/modules/system/system.install index ed181f2..be05e16 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1647,3 +1647,21 @@ function system_update_8014() { /** * @} End of "addtogroup updates-8.0.0-rc". */ + +/** + * @addtogroup updates-8.3.x + * @{ + */ + +/** + * Add install profile to core.extension configuration. + */ +function system_update_8300() { + \Drupal::configFactory()->getEditable('core.extension') + ->set('profile', \Drupal::installProfile()) + ->save(); +} + +/** + * @} End of "addtogroup updates-8.3.x". + */