Skip to content

Commit

Permalink
fixed exception when usung non root pages
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Jul 22, 2020
1 parent 22c4fb3 commit 168fb06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog

## [1.3.2] - 2020-07-22
- fixed non-root pages leading to exception

## [1.3.1] - 2020-04-17
- fixed root page url was used instead of index page url

Expand Down
6 changes: 5 additions & 1 deletion src/Module/ModuleRootnav.php
Expand Up @@ -119,7 +119,11 @@ protected function generateNavigationItems(array $pages, $groups, $targetPages)

// Do not show protected pages unless a back end or front end user is logged in
if (!$page['protected'] || BE_USER_LOGGED_IN || (\is_array($pageGroups) && \count(array_intersect($pageGroups, $groups))) || $this->showProtected) {
$model = PageModel::findFirstPublishedByPid($page['id']);
if ('root' === $page['type']) {
$model = PageModel::findFirstPublishedByPid($page['id']);
} else {
$model = PageModel::findByPk($page['id']);
}
$href = $model->getAbsoluteUrl();

$trail = \in_array($page['id'], $objPage->trail, true);
Expand Down

0 comments on commit 168fb06

Please sign in to comment.