From a43ee592458b712750e5184fb93118af90ff07fe Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 1 Aug 2017 11:26:04 +0200 Subject: [PATCH] Always make sure pages have detail (#120) --- .../Terminal42/ChangeLanguage/Navigation/NavigationItem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Terminal42/ChangeLanguage/Navigation/NavigationItem.php b/library/Terminal42/ChangeLanguage/Navigation/NavigationItem.php index aebb215..b013146 100644 --- a/library/Terminal42/ChangeLanguage/Navigation/NavigationItem.php +++ b/library/Terminal42/ChangeLanguage/Navigation/NavigationItem.php @@ -60,7 +60,7 @@ public function __construct(PageModel $rootPage, $label = null) ); } - $this->rootPage = $rootPage; + $this->rootPage = $rootPage->loadDetails(); $this->linkLabel = $label; if (null === $label) { @@ -136,7 +136,7 @@ public function getTargetPage() */ public function setTargetPage(PageModel $targetPage, $isDirectFallback, $isCurrentPage = false) { - $this->targetPage = $targetPage; + $this->targetPage = $targetPage->loadDetails(); $this->isDirectFallback = (bool) $isDirectFallback; $this->isCurrentPage = (bool) $isCurrentPage; } @@ -221,7 +221,7 @@ public function getHref(UrlParameterBag $urlParameterBag) $href = \Controller::generateFrontendUrl( $targetPage->row(), $urlParameterBag->generateParameters(), - $targetPage->language, + $targetPage->rootLanguage, true );