diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 7d8bc8a3ed46fa354d1c5f9a30a6dff0716989b7..222f05a21c9b29d4cc5cbfb84614fc2de59b0f06 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -26,6 +26,7 @@ use Drupal\Core\Render\Element; use Drupal\Core\Render\Markup; use Drupal\Core\Utility\TableSort; +use Drupal\Core\Installer\InstallerKernel; /** * @defgroup content_flags Content markers @@ -1505,13 +1506,18 @@ function template_preprocess_maintenance_page(&$variables) { * @see template_preprocess_maintenance_page() */ function template_preprocess_install_page(&$variables) { + $installer_active_task = NULL; + if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE === 'install' && InstallerKernel::installationAttempted()) { + $installer_active_task = $GLOBALS['install_state']['active_task']; + } + template_preprocess_maintenance_page($variables); // Override the site name that is displayed on the page, since Drupal is // still in the process of being installed. $distribution_name = drupal_install_profile_distribution_name(); $variables['site_name'] = $distribution_name; - $variables['site_version'] = drupal_install_profile_distribution_version(); + $variables['site_version'] = $installer_active_task ? drupal_install_profile_distribution_version() : ''; } /** diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php index 8906a2fa4da01dedc7ca5fb56adbebdddbceeeeb..8090b99bae89cb78454cee5cc2c9880766cd0560 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php @@ -22,6 +22,9 @@ public function testInstaller() { $this->visitInstaller(); $this->assertSession()->pageTextContains('Drupal already installed'); + // Verify that Drupal version is not displayed. + $this->assertSession()->pageTextNotContains(\Drupal::VERSION); + // Delete settings.php and attempt to reinstall again. unlink($this->siteDirectory . '/settings.php'); $this->visitInstaller();