diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f3f728..c89ae28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [1.20.2] - 2023-04-06 +- Fixed: layout not correctly evaluated on some error pages + ## [1.20.1] - 2023-04-04 - Changed: more errors on prepare command if something went wrong diff --git a/src/Helper/ConfigurationHelper.php b/src/Helper/ConfigurationHelper.php index 29817da..e0ab9e8 100644 --- a/src/Helper/ConfigurationHelper.php +++ b/src/Helper/ConfigurationHelper.php @@ -131,7 +131,8 @@ private function evaluateIsEnabled(?PageModel $pageModel, Request $request): boo return false; } - $layout = $this->contaoFramework->getAdapter(LayoutModel::class)->findByPk($pageModel->layoutId); + $pageModel->loadDetails(); + $layout = $this->contaoFramework->getAdapter(LayoutModel::class)->findByPk($pageModel->layoutId ?? $pageModel->layout); if (!$layout || !$layout->addEncore) { return false;