Skip to content
Snippets Groups Projects
Commit 92ee8c54 authored by catch's avatar catch
Browse files

Issue #2458925 by alexpott: Screen is black and completely unreadable in...

Issue #2458925 by alexpott: Screen is black and completely unreadable in Configure page after install on standard profile
parent 364a6e9c
No related branches found
No related tags found
No related merge requests found
......@@ -1611,21 +1611,13 @@ function install_profile_modules(&$install_state) {
* An array of information about the current installation state.
*/
function install_profile_themes(&$install_state) {
$theme_handler = \Drupal::service('theme_handler');
// ThemeHandler::install() resets the current list of themes. The theme used
// in the installer is not necessarily in the list of themes to install, so
// retain the current list.
// @see _drupal_maintenance_theme()
$current_themes = $theme_handler->listInfo();
// Install the themes specified by the installation profile.
$themes = $install_state['profile_info']['themes'];
$theme_handler->install($themes);
\Drupal::service('theme_handler')->install($themes);
foreach ($current_themes as $theme) {
$theme_handler->addTheme($theme);
}
// Ensure that the install profile's theme is used.
// @see _drupal_maintenance_theme()
\Drupal::service('theme.manager')->resetActiveTheme();
}
/**
......@@ -1644,6 +1636,10 @@ function install_install_profile(&$install_state) {
// optional configuration whose dependencies can be met at this point removes
// any disparities that this creates.
\Drupal::service('config.installer')->installOptionalConfig();
// Ensure that the install profile's theme is used.
// @see _drupal_maintenance_theme()
\Drupal::service('theme.manager')->resetActiveTheme();
}
/**
......
......@@ -68,11 +68,10 @@ function _drupal_maintenance_theme() {
// installed, retrieve all available themes.
/** @var \Drupal\Core\Theme\ThemeInitialization $theme_init */
$theme_init = \Drupal::service('theme.initialization');
$theme_handler = \Drupal::service('theme_handler');
if (empty($themes) || !isset($themes[$custom_theme])) {
$theme_handler = \Drupal::service('theme_handler');
$themes = $theme_handler->rebuildThemeData();
$theme_handler->addTheme($themes[$custom_theme]);
\Drupal::theme()->setActiveTheme($theme_init->getActiveTheme($themes[$custom_theme], array()));
}
// \Drupal\Core\Extension\ThemeHandlerInterface::listInfo() triggers a
......@@ -86,8 +85,12 @@ function _drupal_maintenance_theme() {
$base_theme = array();
$ancestor = $theme;
while ($ancestor && isset($themes[$ancestor]->base_theme)) {
$base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme];
$base_theme[] = $themes[$themes[$ancestor]->base_theme];
$ancestor = $themes[$ancestor]->base_theme;
if ($ancestor) {
// Ensure that the base theme is added.
$theme_handler->addTheme($themes[$ancestor]);
}
}
// @todo This is just a workaround. Find a better way how to handle themes
// on maintenance pages, see https://www.drupal.org/node/2322619.
......
<?php
/**
* @file
* Contains \Drupal\system\Tests\Installer\StandardInstallerTest.
*/
namespace Drupal\system\Tests\Installer;
use Drupal\simpletest\InstallerTestBase;
/**
* Tests the interactive installer installing the standard profile.
*
* @group Installer
*/
class StandardInstallerTest extends InstallerTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'standard';
/**
* Ensures that the user page is available after installation.
*/
public function testInstaller() {
// Verify that the confirmation message appears.
require_once \Drupal::root() . '/core/includes/install.inc';
$this->assertRaw(t('Congratulations, you installed @drupal!', array(
'@drupal' => drupal_install_profile_distribution_name(),
)));
}
/**
* {@inheritdoc}
*/
protected function setUpSite() {
// Test that the correct theme is being used.
$this->assertNoRaw('bartik');
$this->assertRaw('themes/seven/css/theme/install-page.css');
parent::setUpSite();
}
}
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