Theme doesn't load on update.php

Created on 30 August 2024, 7 months ago

I have seven configured as my Admin theme in Structure->Appearance and set in settings.php with `$settings['maintenance_theme'] = 'seven';`

However my default theme loads on update.php.

I even tried creating a small custom module to force seven as the theme on the update.php page with

<?php

/**
 * Implements hook_preprocess_HOOK() for page templates.
 */
function essent_theme_fix_preprocess_page(array &$variables) {
  // Check if the current route is the system update route (`update.php`).
  if (\Drupal::routeMatch()->getRouteName() === 'system.update') {
    // Check if the Seven theme is available and enabled.
    $theme_handler = \Drupal::service('theme_handler');
    if ($theme_handler->themeExists('seven')) {
      // Set the active theme to 'seven'.
      \Drupal::theme()->setActiveTheme(\Drupal::theme()->getTheme('seven'));
    }
  }
}

Nothing seems to get this theme working on update.php. I can use Claro just fine though.

I'm using Drupal Core 10.3.2

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States frogdog_tech

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024