diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php index 6e1c3dafc..2b9050674 100644 --- a/modules/cms/classes/Theme.php +++ b/modules/cms/classes/Theme.php @@ -95,8 +95,8 @@ class Theme */ public static function exists($dirName) { - $theme = new static; - $path = $theme->getPath($dirName); + $theme = static::load($dirName); + $path = $theme->getPath(); return File::isDirectory($path); } @@ -133,7 +133,7 @@ class Theme ->pluck('value') ; - if ($dbResult !== null) { + if ($dbResult !== null && static::exists($dbResult)) { $activeTheme = $dbResult; } } diff --git a/modules/cms/controllers/themes/_theme_list.htm b/modules/cms/controllers/themes/_theme_list.htm index 3fe0fcb7b..66070e94e 100644 --- a/modules/cms/controllers/themes/_theme_list.htm +++ b/modules/cms/controllers/themes/_theme_list.htm @@ -6,7 +6,7 @@ $theme): ?> getDirName() == $theme->getDirName(); + $isActive = $activeTheme && $activeTheme->getDirName() == $theme->getDirName(); $author = $theme->getConfigValue('author'); ?>