Commit 748dd319 authored by Cristina Chumillas's avatar Cristina Chumillas
Browse files

Issue #3085219 by mherchel, jwilson3, lauriii, andy-blum, javi-er,...

Issue #3085219 by mherchel, jwilson3, lauriii, andy-blum, javi-er, deviantintegral, raman.b, kostyashupenko, komalk, rootwork, rkoller, saschaeggi, Abhijith S, cindytwilliams, benjifisher, AaronMcHale, nod_, Gábor Hojtsy, ckrina, alexpott, huzooka: Installer is not very usable in Claro
parent fbcf0fb7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ function install_state_defaults() {
    // An array of available installation profiles.
    'profiles' => [],
    // The name of the theme to use during installation.
    'theme' => 'seven',
    'theme' => 'claro',
    // The server URL where the interface translation files can be downloaded.
    // Tokens in the pattern will be replaced by appropriate values for the
    // required translation file.
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ function _drupal_maintenance_theme() {
      $custom_theme = $GLOBALS['install_state']['theme'];
    }
    else {
      $custom_theme = Settings::get('maintenance_theme', 'seven');
      $custom_theme = Settings::get('maintenance_theme', 'claro');
    }
  }
  else {
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public function testInstaller() {
  protected function setUpLanguage() {
    // Test that \Drupal\Core\Render\BareHtmlPageRenderer adds assets and
    // metatags as expected to the first page of the installer.
    $this->assertSession()->responseContains("core/themes/seven/css/components/buttons.css");
    $this->assertSession()->responseContains("core/themes/claro/css/components/button.css");
    $this->assertSession()->responseContains('<meta charset="utf-8" />');

    // Assert that the expected title is present.
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public function testInstaller() {
  protected function setUpSite() {
    // Test that the correct theme is being used.
    $this->assertSession()->responseNotContains('olivero');
    $this->assertSession()->responseContains('themes/seven/css/theme/install-page.css');
    $this->assertSession()->responseContains('themes/claro/css/theme/install-page.css');
    parent::setUpSite();
  }

+21 −0
Original line number Diff line number Diff line
@@ -326,6 +326,27 @@ function claro_preprocess_maintenance_page(&$variables) {
  $variables['#attached']['library'][] = 'claro/maintenance-page';
}

/**
 * Implements hook_theme_suggestions_maintenance_page_alter().
 */
function claro_theme_suggestions_maintenance_page_alter(&$suggestions) {
  try {
    $is_front = \Drupal::service('path.matcher')->isFrontPage();
  }
  catch (Exception $e) {
    // An exception could mean that the database is offline. This scenario
    // should also be rendered using the frontpage template.
    $is_front = TRUE;
  }

  if ($is_front) {
    // Add theme suggestion for maintenance page rendered as front page. This
    // allows separating different applications such as update.php from the
    // actual maintenance page.
    $suggestions[] = 'maintenance_page__front';
  }
}

/**
 * Implements hook_preprocess_HOOK() for details.
 *
Loading