diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-30 23:09:14 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-30 23:09:14 +0000 |
commit | cf8ef30aa1baeb39da4c189853e051e17969aba1 (patch) | |
tree | c29fb2c9e8a970898acadedaee72e9531c7b823c /includes | |
parent | 442fe5198cc4705d27e4c4232fc989f61a5d020e (diff) | |
download | brdo-cf8ef30aa1baeb39da4c189853e051e17969aba1.tar.gz brdo-cf8ef30aa1baeb39da4c189853e051e17969aba1.tar.bz2 |
#141727 follow up by dvessel: fix maintenance theme in updates
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 10 | ||||
-rw-r--r-- | includes/theme.maintenance.inc | 18 |
2 files changed, 17 insertions, 11 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 41eab6e3f..e46f7f411 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -416,7 +416,8 @@ function list_themes($refresh = FALSE) { $list = array(); $themes = array(); // Extract from the database only when it is available. - if (db_is_active() && db_table_exists('system')) { + // Also check that the site is not in the middle of an install or update. + if (db_is_active() && !defined('MAINTENANCE_MODE')) { $result = db_query("SELECT * FROM {system} WHERE type = '%s'", 'theme'); while ($theme = db_fetch_object($result)) { if (file_exists($theme->filename)) { @@ -426,7 +427,7 @@ function list_themes($refresh = FALSE) { } } else { - // When the database is unavailable, scan the installation. + // Scan the installation when the database should not be read. $themes = _system_theme_data(); } @@ -449,6 +450,11 @@ function list_themes($refresh = FALSE) { if (isset($theme->info['base theme'])) { $theme->base_theme = $theme->info['base theme']; } + // Status is normally retrieved from the database. Add zero values when + // read from the installation directory to prevent notices. + if (!isset($theme->status)) { + $theme->status = 0; + } $list[$theme->name] = $theme; } } diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index cfc34e09b..142ae91ee 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -31,23 +31,23 @@ function _drupal_maintenance_theme() { require_once './includes/database.inc'; unicode_check(); - // Load module basics (needed for hook invokes). - $module_list['system']['filename'] = 'modules/system/system.module'; - $module_list['filter']['filename'] = 'modules/filter/filter.module'; - module_list(TRUE, FALSE, FALSE, $module_list); - drupal_load('module', 'system'); - drupal_load('module', 'filter'); - - $themes = list_themes(); - // Install and update pages are treated differently to prevent theming overrides. if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install' || MAINTENANCE_MODE == 'update')) { $theme = 'minnelli'; } else { + // Load module basics (needed for hook invokes). + $module_list['system']['filename'] = 'modules/system/system.module'; + $module_list['filter']['filename'] = 'modules/filter/filter.module'; + module_list(TRUE, FALSE, FALSE, $module_list); + drupal_load('module', 'system'); + drupal_load('module', 'filter'); + $theme = variable_get('maintenance_theme', 'minnelli'); } + $themes = list_themes(); + // Store the identifier for retrieving theme settings with. $theme_key = $theme; |