Fixes #788 - Fall back to config theme when db theme fails.
This commit is contained in:
parent
846a312765
commit
001e86456d
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<?php foreach ($themes as $index => $theme): ?>
|
||||
<?php
|
||||
$isLast = $index == $cnt-1;
|
||||
$isActive = $activeTheme->getDirName() == $theme->getDirName();
|
||||
$isActive = $activeTheme && $activeTheme->getDirName() == $theme->getDirName();
|
||||
$author = $theme->getConfigValue('author');
|
||||
?>
|
||||
<div class="layout-row <?= $isLast ? 'last' : null ?> min-size <?= $isActive ? 'active' : null ?>">
|
||||
|
|
|
|||
Loading…
Reference in New Issue