From e426775fd55ee7e5a6129d77da30e517b58eb27d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 25 May 2002 06:47:47 +0000 Subject: - Bugfix. When a theme does no longer exist on disk, it should not be returned by theme_list() as it breaks the site ... The attached patch prevents this from happening but does not remove the theme from the system table in the SQL database - if the theme is removed from the database upon viewing the themes administration page (or another trigger), I guess that is fine. Kjartan: my fix is the right thing to apply because theme_list() is used elsewhere where it requires to return a list of existing themes. Maybe it's a little sad but the current theme loading code might be slower and more complex than the old Drupal 3 theme loading code ... ? --- includes/theme.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'includes/theme.inc') diff --git a/includes/theme.inc b/includes/theme.inc index 4aa89b6d6..11d2c82e9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -40,7 +40,7 @@ class BaseTheme { $terms[] = l($term->name, array("or" => $term->tid), "index"); } } - + $output = "". check_output($node->title) ." by ". format_name($node) ."
"; if (count($terms)) { $output .= "(". $this->links($terms) .")
"; @@ -97,7 +97,9 @@ function theme_list() { $list = array(); $result = db_query("SELECT * FROM system where type = 'theme' AND status = '1' ORDER BY name"); while ($theme = db_fetch_object($result)) { - $list[$theme->name] = $theme; + if (file_exists($theme->filename)) { + $list[$theme->name] = $theme; + } } } -- cgit v1.2.3