Commit f7ded66b authored by Fabian Galinski's avatar Fabian Galinski

[BUGFIX] The languagevisibility integration checks only english sites

parent 6050edeb
......@@ -26,6 +26,7 @@ namespace SGalinski\DdGooglesitemapPlugin\Xclass;
***************************************************************/
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\Languagevisibility\Service\FrontendServices;
/**
......@@ -41,7 +42,12 @@ class PagesSitemapGenerator extends \DmitryDulepov\DdGooglesitemap\Generator\Pag
protected function shouldIncludePageInSitemap(array $pageInfo) {
$shouldInclude = TRUE;
if (ExtensionManagementUtility::isLoaded('languagevisibility')) {
$shouldInclude = FrontendServices::checkVisiblityForElement($pageInfo['uid'], 'pages', 0);
/** @var TypoScriptFrontendController $tsfe */
$tsfe = $GLOBALS['TSFE'];
$languageUid = (int) $tsfe->sys_language_uid;
if ($languageUid >= 0) {
$shouldInclude = FrontendServices::checkVisiblityForElement($pageInfo['uid'], 'pages', $languageUid);
}
}
return $shouldInclude && !$pageInfo['no_search'] && !in_array($pageInfo['doktype'], $this->excludedPageTypes);
......
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