summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc10
1 files changed, 8 insertions, 2 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;
}
}