diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 869cae81bd..a869d90b53 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -415,6 +415,7 @@ function install_begin_request($class_loader, &$install_state) { else { $environment = 'prod'; } + $GLOBALS['conf']['container_service_providers']['InstallerConfigOverride'] = 'Drupal\Core\Installer\ConfigOverride'; // Only allow dumping the container once the hash salt has been created. $kernel = InstallerKernel::createFromRequest($request, $class_loader, $environment, (bool) Settings::get('hash_salt', FALSE)); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index a8591ca989..68b10b3e42 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1322,12 +1322,6 @@ function template_preprocess_html(&$variables) { } } - // Early in the installer the site name is unknown. In this case we need to - // fallback to the distribution's name. - if (empty($head_title['name']) && drupal_installation_attempted() && function_exists('drupal_install_profile_distribution_name')) { - $head_title['name'] = drupal_install_profile_distribution_name(); - } - $variables['head_title'] = $head_title; // @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. $variables['head_title_array'] = $head_title; diff --git a/core/lib/Drupal/Core/Installer/ConfigOverride.php b/core/lib/Drupal/Core/Installer/ConfigOverride.php new file mode 100644 index 0000000000..f6bf966d93 --- /dev/null +++ b/core/lib/Drupal/Core/Installer/ConfigOverride.php @@ -0,0 +1,62 @@ +register('core.install_config_override', static::class) + ->addTag('config.factory.override'); + } + + /** + * @inheritDoc + */ + public function loadOverrides($names) { + $overrides = []; + if (drupal_installation_attempted() && function_exists('drupal_install_profile_distribution_name')) { + // Early in the installer the site name is unknown. In this case we need to + // fallback to the distribution's name. + $overrides['system.site'] = [ + 'name' => drupal_install_profile_distribution_name(), + ]; + } + return $overrides; + } + + /** + * @inheritDoc + */ + public function getCacheSuffix() { + return 'core.install_config_override'; + } + + /** + * @inheritDoc + */ + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { + return NULL; + } + + /** + * @inheritDoc + */ + public function getCacheableMetadata($name) { + return new CacheableMetadata(); + } + +}