Commit 828ab7cf authored by Fabian Galinski's avatar Fabian Galinski 😾

[BUGFIX] A page link to another language isn't working

parent 5f80b1d8
......@@ -75,8 +75,6 @@ class PageHook implements PageRepositoryGetPageOverlayHookInterface, PageReposit
}
$pageInputIsArray = is_array($pageInput);
$languageUid = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('language', 'id');
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
$row = $queryBuilder->select('*')
......@@ -90,7 +88,7 @@ class PageHook implements PageRepositoryGetPageOverlayHookInterface, PageReposit
return;
}
if ($languageUid >= 0 && !FrontendServices::checkVisiblityForElement($row, 'pages', $languageUid)) {
if ($lUid >= 0 && !FrontendServices::checkVisiblityForElement($row, 'pages', $lUid)) {
if ($pageInputIsArray) {
$pageInput['_NOTVISIBLE'] = TRUE;
}
......@@ -98,7 +96,7 @@ class PageHook implements PageRepositoryGetPageOverlayHookInterface, PageReposit
}
// call service to know if element is visible and which overlay language to use
$overlayLanguage = FrontendServices::getOverlayLanguageIdForElementRecord($row, 'pages', $languageUid);
$overlayLanguage = FrontendServices::getOverlayLanguageIdForElementRecord($row, 'pages', $lUid);
if ($overlayLanguage === FALSE) {
if ($pageInputIsArray) {
$pageInput['_NOTVISIBLE'] = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment