From d8b37366cb14e98874d88e67d032822eaf224ce1 Mon Sep 17 00:00:00 2001 From: Celestora Date: Sun, 12 Dec 2021 16:08:38 +0200 Subject: [PATCH] Fix theme inclusion regression for themes that do not override templates --- Web/Presenters/OpenVKPresenter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/OpenVKPresenter.php b/Web/Presenters/OpenVKPresenter.php index eed07884..5930abb7 100755 --- a/Web/Presenters/OpenVKPresenter.php +++ b/Web/Presenters/OpenVKPresenter.php @@ -221,13 +221,17 @@ abstract class OpenVKPresenter extends SimplePresenter { parent::onBeforeRender(); - if(Session::i()->get("_tempTheme")) + $theme = NULL; + if(Session::i()->get("_tempTheme")) { $theme = Themepacks::i()[Session::i()->get("_tempTheme", "ovk")]; - else if($this->requestParam("themePreview")) + Session::i()->set("_tempTheme", NULL); + } else if($this->requestParam("themePreview")) { $theme = Themepacks::i()[$this->requestParam("themePreview")]; - else if($this->user->identity !== null && $this->user->identity->getTheme()) + } else if($this->user->identity !== null && $this->user->identity->getTheme()) { $theme = $this->user->identity->getTheme(); + } + $this->template->theme = $theme; if(!is_null($theme) && $theme->overridesTemplates()) $this->template->_templatePath = $theme->getBaseDir() . "/tpl";