Loading core/includes/install.core.inc +16 −22 Original line number Diff line number Diff line Loading @@ -348,7 +348,6 @@ function install_begin_request($class_loader, &$install_state): void { // Ensure that procedural dependencies are loaded as early as possible, // since the error/exception handlers depend on them. require_once __DIR__ . '/../modules/system/system.install'; require_once __DIR__ . '/common.inc'; require_once __DIR__ . '/install.inc'; require_once __DIR__ . '/form.inc'; Loading Loading @@ -1120,7 +1119,6 @@ function install_verify_requirements(&$install_state) { * An array of information about the current installation state. */ function install_base_system(&$install_state): void { // Install system.module. drupal_install_system($install_state); // Call HtaccessWriter::ensure() to ensure that all of Drupal's standard Loading Loading @@ -1610,8 +1608,7 @@ function install_profile_modules(&$install_state) { $modules = array_merge($modules, array_keys($files[$module]->requires)); } } // The System module has already been installed by install_base_system(). $modules = array_diff(array_unique($modules), ['system']); foreach ($modules as $module) { if (!empty($files[$module]->info['required'])) { $required[$module] = $files[$module]->sort; Loading Loading @@ -1652,7 +1649,7 @@ function install_profile_modules(&$install_state) { } $batch_builder->addOperation( '_install_module_batch', [$module_group, $names], [$module_group, $names, $install_state], ); } $batch_builder Loading Loading @@ -1868,10 +1865,21 @@ function install_finished(&$install_state): void { * * Performs batch installation of modules. */ function _install_module_batch(array $modules, array $module_names, array &$context): void { function _install_module_batch(array $modules, array $module_names, array $install_state, array &$context): void { \Drupal::service('module_installer')->install($modules, FALSE); $context['results'] = array_merge($context['results'], $modules); $context['message'] = \Drupal::translation()->formatPlural(count($module_names), 'Installed %module module.', 'Installed %module modules.', ['%module' => implode(', ', $module_names)]); // If installing system module, set the langcode to the one chosen in the // installer. if (in_array('system', $modules)) { if (isset($install_state['parameters']['langcode'])) { \Drupal::configFactory()->getEditable('system.site') ->set('langcode', (string) $install_state['parameters']['langcode']) ->set('default_langcode', (string) $install_state['parameters']['langcode']) ->save(); } } } /** Loading Loading @@ -2329,17 +2337,6 @@ function install_config_import_batch() { // Get the sync storage. $sync = \Drupal::service('config.storage.sync'); // Match up the site UUIDs, the install_base_system install task will have // installed the system module and created a new UUID. $system_site = $sync->read('system.site'); // When installing from configuration it is possible that system.site // configuration is not present. If this occurs a ConfigImporterException will // by thrown when $config_importer->initialize() is called below and the error // will be reported to the user. if ($system_site !== FALSE) { \Drupal::configFactory()->getEditable('system.site')->set('uuid', $system_site['uuid'])->save(); } // Create the storage comparer and the config importer. $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage')); $storage_comparer->createChangelist(); Loading Loading @@ -2525,7 +2522,7 @@ function _install_config_locale_overrides_process_batch(array $names, array $lan * @internal * All installer code is internal. */ function install_recipe_required_modules() { function install_recipe_required_modules(array $install_state) { // We need to manually trigger the installation of core-provided entity types, // as those will not be handled by the module installer. // @see install_profile_modules() Loading @@ -2550,9 +2547,6 @@ function install_recipe_required_modules() { } arsort($required); // The system module is already installed. See install_base_system(). unset($required['system']); $modules = []; $names = []; foreach ($required as $module => $weight) { Loading @@ -2560,7 +2554,7 @@ function install_recipe_required_modules() { $names[] = $files[$module]->info['name']; } $batch_builder->addOperation('_install_module_batch', [$modules, $names] [$modules, $names, $install_state] ); return $batch_builder->toArray(); } Loading core/includes/install.inc +1 −12 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ function drupal_verify_profile($install_state): array { } /** * Installs the system module. * Install the base system and any required database drivers. * * Separated from the installation of other modules so core system * functions can be made available while other modules are installed. Loading Loading @@ -240,17 +240,6 @@ function drupal_install_system($install_state): void { $kernel->getContainer()->get('module_installer')->install([$provider], TRUE); } } // Install System module. $kernel->getContainer()->get('module_installer')->install(['system'], FALSE); // Ensure default language is saved. if (isset($install_state['parameters']['langcode'])) { \Drupal::configFactory()->getEditable('system.site') ->set('langcode', (string) $install_state['parameters']['langcode']) ->set('default_langcode', (string) $install_state['parameters']['langcode']) ->save(); } } /** Loading core/lib/Drupal/Core/Config/StorageComparer.php +8 −3 Original line number Diff line number Diff line Loading @@ -431,11 +431,16 @@ public function hasChanges() { * {@inheritdoc} */ public function validateSiteUuid() { $source = $this->sourceStorage->read('system.site'); $target = $this->targetStorage->read('system.site'); // It is possible that the storage does not contain system.site // If there is no target configuration yet, then the entire site may be // getting reinstalled from config. if (!$target) { return TRUE; } $source = $this->sourceStorage->read('system.site'); // It is possible that the source storage does not contain system.site // configuration. In such cases the site UUID cannot be valid. return $source && $target && $source['uuid'] === $target['uuid']; return $source && $source['uuid'] === $target['uuid']; } /** Loading core/lib/Drupal/Core/DrupalKernel.php +12 −0 Original line number Diff line number Diff line Loading @@ -1528,6 +1528,18 @@ protected function compileContainer() { $default_language_values = ['id' => $system['langcode']]; } } else { // If the system.site config doesn't exist, then we're in the installer, // if langcode is set in install state parameters, then set that as the // default language. This allows the default language to be correct on the // container just before system module is installed. // @todo move default language configuration to core from system module so // that it can be set prior to system module install without workarounds. // @see https://www.drupal.org/project/drupal/issues/3615365 if (isset($GLOBALS['install_state']['parameters']['langcode'])) { $default_language_values['id'] = $GLOBALS['install_state']['parameters']['langcode']; } } $container->setParameter('language.default_values', $default_language_values); // Register synthetic services. Loading core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class BasicAuthTest extends BrowserTestBase { 'router_test', 'locale', 'basic_auth_test', 'page_cache', 'dynamic_page_cache', ]; /** Loading Loading
core/includes/install.core.inc +16 −22 Original line number Diff line number Diff line Loading @@ -348,7 +348,6 @@ function install_begin_request($class_loader, &$install_state): void { // Ensure that procedural dependencies are loaded as early as possible, // since the error/exception handlers depend on them. require_once __DIR__ . '/../modules/system/system.install'; require_once __DIR__ . '/common.inc'; require_once __DIR__ . '/install.inc'; require_once __DIR__ . '/form.inc'; Loading Loading @@ -1120,7 +1119,6 @@ function install_verify_requirements(&$install_state) { * An array of information about the current installation state. */ function install_base_system(&$install_state): void { // Install system.module. drupal_install_system($install_state); // Call HtaccessWriter::ensure() to ensure that all of Drupal's standard Loading Loading @@ -1610,8 +1608,7 @@ function install_profile_modules(&$install_state) { $modules = array_merge($modules, array_keys($files[$module]->requires)); } } // The System module has already been installed by install_base_system(). $modules = array_diff(array_unique($modules), ['system']); foreach ($modules as $module) { if (!empty($files[$module]->info['required'])) { $required[$module] = $files[$module]->sort; Loading Loading @@ -1652,7 +1649,7 @@ function install_profile_modules(&$install_state) { } $batch_builder->addOperation( '_install_module_batch', [$module_group, $names], [$module_group, $names, $install_state], ); } $batch_builder Loading Loading @@ -1868,10 +1865,21 @@ function install_finished(&$install_state): void { * * Performs batch installation of modules. */ function _install_module_batch(array $modules, array $module_names, array &$context): void { function _install_module_batch(array $modules, array $module_names, array $install_state, array &$context): void { \Drupal::service('module_installer')->install($modules, FALSE); $context['results'] = array_merge($context['results'], $modules); $context['message'] = \Drupal::translation()->formatPlural(count($module_names), 'Installed %module module.', 'Installed %module modules.', ['%module' => implode(', ', $module_names)]); // If installing system module, set the langcode to the one chosen in the // installer. if (in_array('system', $modules)) { if (isset($install_state['parameters']['langcode'])) { \Drupal::configFactory()->getEditable('system.site') ->set('langcode', (string) $install_state['parameters']['langcode']) ->set('default_langcode', (string) $install_state['parameters']['langcode']) ->save(); } } } /** Loading Loading @@ -2329,17 +2337,6 @@ function install_config_import_batch() { // Get the sync storage. $sync = \Drupal::service('config.storage.sync'); // Match up the site UUIDs, the install_base_system install task will have // installed the system module and created a new UUID. $system_site = $sync->read('system.site'); // When installing from configuration it is possible that system.site // configuration is not present. If this occurs a ConfigImporterException will // by thrown when $config_importer->initialize() is called below and the error // will be reported to the user. if ($system_site !== FALSE) { \Drupal::configFactory()->getEditable('system.site')->set('uuid', $system_site['uuid'])->save(); } // Create the storage comparer and the config importer. $storage_comparer = new StorageComparer($sync, \Drupal::service('config.storage')); $storage_comparer->createChangelist(); Loading Loading @@ -2525,7 +2522,7 @@ function _install_config_locale_overrides_process_batch(array $names, array $lan * @internal * All installer code is internal. */ function install_recipe_required_modules() { function install_recipe_required_modules(array $install_state) { // We need to manually trigger the installation of core-provided entity types, // as those will not be handled by the module installer. // @see install_profile_modules() Loading @@ -2550,9 +2547,6 @@ function install_recipe_required_modules() { } arsort($required); // The system module is already installed. See install_base_system(). unset($required['system']); $modules = []; $names = []; foreach ($required as $module => $weight) { Loading @@ -2560,7 +2554,7 @@ function install_recipe_required_modules() { $names[] = $files[$module]->info['name']; } $batch_builder->addOperation('_install_module_batch', [$modules, $names] [$modules, $names, $install_state] ); return $batch_builder->toArray(); } Loading
core/includes/install.inc +1 −12 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ function drupal_verify_profile($install_state): array { } /** * Installs the system module. * Install the base system and any required database drivers. * * Separated from the installation of other modules so core system * functions can be made available while other modules are installed. Loading Loading @@ -240,17 +240,6 @@ function drupal_install_system($install_state): void { $kernel->getContainer()->get('module_installer')->install([$provider], TRUE); } } // Install System module. $kernel->getContainer()->get('module_installer')->install(['system'], FALSE); // Ensure default language is saved. if (isset($install_state['parameters']['langcode'])) { \Drupal::configFactory()->getEditable('system.site') ->set('langcode', (string) $install_state['parameters']['langcode']) ->set('default_langcode', (string) $install_state['parameters']['langcode']) ->save(); } } /** Loading
core/lib/Drupal/Core/Config/StorageComparer.php +8 −3 Original line number Diff line number Diff line Loading @@ -431,11 +431,16 @@ public function hasChanges() { * {@inheritdoc} */ public function validateSiteUuid() { $source = $this->sourceStorage->read('system.site'); $target = $this->targetStorage->read('system.site'); // It is possible that the storage does not contain system.site // If there is no target configuration yet, then the entire site may be // getting reinstalled from config. if (!$target) { return TRUE; } $source = $this->sourceStorage->read('system.site'); // It is possible that the source storage does not contain system.site // configuration. In such cases the site UUID cannot be valid. return $source && $target && $source['uuid'] === $target['uuid']; return $source && $source['uuid'] === $target['uuid']; } /** Loading
core/lib/Drupal/Core/DrupalKernel.php +12 −0 Original line number Diff line number Diff line Loading @@ -1528,6 +1528,18 @@ protected function compileContainer() { $default_language_values = ['id' => $system['langcode']]; } } else { // If the system.site config doesn't exist, then we're in the installer, // if langcode is set in install state parameters, then set that as the // default language. This allows the default language to be correct on the // container just before system module is installed. // @todo move default language configuration to core from system module so // that it can be set prior to system module install without workarounds. // @see https://www.drupal.org/project/drupal/issues/3615365 if (isset($GLOBALS['install_state']['parameters']['langcode'])) { $default_language_values['id'] = $GLOBALS['install_state']['parameters']['langcode']; } } $container->setParameter('language.default_values', $default_language_values); // Register synthetic services. Loading
core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class BasicAuthTest extends BrowserTestBase { 'router_test', 'locale', 'basic_auth_test', 'page_cache', 'dynamic_page_cache', ]; /** Loading