Skip to content
Snippets Groups Projects
Commit f0e557d3 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Sitemap - Respect the overlay type correctly

parent a51f4942
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
namespace SGalinski\SgJobs\Service;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\LanguageAspect;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use SgJobsPageRepository;
......@@ -30,6 +31,7 @@ class SitemapService {
* @param int $sysLanguageUid
* @param int $rootPageId
* @return array
* @throws \TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
*/
public function generatePagesList(int $sysLanguageUid, int $rootPageId = 0): array {
$pageList = [];
......@@ -113,6 +115,8 @@ class SitemapService {
$rows = $databaseResource->fetchAll();
$pageRepository = GeneralUtility::makeInstance(SgJobsPageRepository::class);
$isLanguageVisibilityLoaded = ExtensionManagementUtility::isLoaded('languagevisibility');
$languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');
$overlayType = $languageAspect->getLegacyOverlayType();
foreach ($rows as $row) {
$table = 'tx_sgjobs_domain_model_job';
......@@ -133,7 +137,11 @@ class SitemapService {
}
if ($languageId > 0) {
$row = $pageRepository->getRecordOverlay($table, $row, $languageId);
/** @var LanguageAspect $languageAspect */
$row = $pageRepository->getRecordOverlay($table, $row, $languageId, $overlayType);
if (!is_array($row) || !count($row)) {
continue;
}
}
$visibleRows[] = $row;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment