Skip to content

Commit

Permalink
[BUGFIX] Only attempt TSFE->sys_language_uid if LanguageAspect not found
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jan 28, 2025
1 parent 74596bf commit cba2d03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,14 @@ public function hidePageForLanguageUid($page = null, int $languageUid = -1, bool
$pageRecord = $this->getPage($pageUid);
}
if (-1 === $languageUid) {
$languageUid = $GLOBALS['TSFE']->sys_language_uid;
if (class_exists(LanguageAspect::class)) {
/** @var Context $context */
$context = GeneralUtility::makeInstance(Context::class);
/** @var LanguageAspect $languageAspect */
$languageAspect = $context->getAspect('language');
$languageUid = $languageAspect->getId();
} else {
$languageUid = $GLOBALS['TSFE']->sys_language_uid;
}
}

Expand Down

0 comments on commit cba2d03

Please sign in to comment.