diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index 4c8023e..c860c6d 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -45,19 +45,21 @@ function _drupal_maintenance_theme() { } // We use the default theme as the maintenance theme. If a default theme - // isn't specified in the database or in settings.php, we use Bartik. + // isn't specified in config or in settings.php, we use Bartik. // @todo Should use the actual default theme configured, but that depends on // configuration being available while possibly not having a working // database connection (yet). And only if that fails, should fall back to // Stark otherwise. Since there is no low-level access to configuration // currently, we only consult settings.php and fall back to Bartik // otherwise, as it looks generic enough and way more user-friendly. - if (($config = \Drupal::config('system.theme')) && is_object($config)) { - $custom_theme = $config->get('default'); - } - else { + if (!$custom_theme = settings()->get('maintenance_theme', '')) { // A broken install might not return an object. - $custom_theme = settings()->get('maintenance_theme', 'bartik'); + if (($config = \Drupal::config('system.theme')) && is_object($config)) { + $custom_theme = $config->get('default'); + } + } + if (!$custom_theme) { + $custom_theme = 'bartik'; } }