diff --git a/protected/humhub/modules/ui/view/bootstrap/ThemeLoader.php b/protected/humhub/modules/ui/view/bootstrap/ThemeLoader.php index 1c32a56495..91ea985f54 100644 --- a/protected/humhub/modules/ui/view/bootstrap/ThemeLoader.php +++ b/protected/humhub/modules/ui/view/bootstrap/ThemeLoader.php @@ -9,6 +9,7 @@ namespace humhub\modules\ui\view\bootstrap; use humhub\libs\BaseSettingsManager; +use humhub\modules\ui\view\components\Theme; use humhub\modules\ui\view\helpers\ThemeHelper; use yii\base\BootstrapInterface; @@ -33,18 +34,18 @@ class ThemeLoader implements BootstrapInterface } $themePath = $app->settings->get('theme'); - if (empty($themePath) || !is_dir($themePath)) { - return; + if (!empty($themePath) && is_dir($themePath)) { + $theme = ThemeHelper::getThemeByPath($themePath); + + if ($theme !== null) { + $app->view->theme = $theme; + $app->mailer->view->theme = $theme; + } } - $theme = ThemeHelper::getThemeByPath($themePath); - - if ($theme !== null) { - $app->view->theme = $theme; - $app->mailer->view->theme = $theme; + if ($app->view->theme instanceof Theme) { + $app->view->theme->register(); } - - $theme->register(); } } diff --git a/protected/humhub/tests/codeception/config/dynamic.php b/protected/humhub/tests/codeception/config/dynamic.php index 2454a242a4..69efa3c090 100644 --- a/protected/humhub/tests/codeception/config/dynamic.php +++ b/protected/humhub/tests/codeception/config/dynamic.php @@ -22,24 +22,6 @@ array ( ), 'useFileTransport' => true, - 'view' => - array ( - 'theme' => - array ( - 'name' => 'HumHub', - 'basePath' => 'E:\\codebase\\humhub\\master/themes\\HumHub', - 'publishResources' => false, - ), - ), - ), - 'view' => - array ( - 'theme' => - array ( - 'name' => 'HumHub', - 'basePath' => 'E:\\codebase\\humhub\\master/themes\\HumHub', - 'publishResources' => false, - ), ), 'cache' => array (