Commit f3d236c6 authored by Kevin Ditscheid's avatar Kevin Ditscheid

[BUGFIX] Fix checking visibility of non overlayed records

parent 35e19f0f
......@@ -119,19 +119,24 @@ class PageHook implements \LanguageVisibilityPageRepositoryGetPageOverlayHookInt
}
if ($row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] > 0) {
$originalRow = BackendUtility::getRecord($table, $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']]);
$originalRow = BackendUtility::getRecord(
$table, $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']]
);
$element = FrontendServices::getElement($originalRow, $table);
try {
$site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($row['pid']);
} catch (SiteNotFoundException $e) {
// Somehow the element sits on a page that has no site configuration, we can not handle this
return;
}
} else {
$element = FrontendServices::getElement($row, $table);
}
$siteLanguage = $site->getLanguageById($sys_language_content);
if (!GeneralUtility::makeInstance(VisibilityService::class)->isVisible($siteLanguage, $element)) {
$row = NULL;
}
try {
$site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($row['pid']);
} catch (SiteNotFoundException $e) {
// Somehow the element sits on a page that has no site configuration, we can not handle this
return;
}
$siteLanguage = $site->getLanguageById($sys_language_content);
if (!GeneralUtility::makeInstance(VisibilityService::class)->isVisible($siteLanguage, $element)) {
$row = NULL;
}
}
}
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