Skip to content

Commit

Permalink
another fix for layout loading on error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Apr 6, 2023
1 parent edd0603 commit daef133
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/Helper/ConfigurationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit daef133

Please sign in to comment.