From 477c8326c89ee84bccb6e60058e2b890f3fef881 Mon Sep 17 00:00:00 2001 From: Lukas Vorlicek Date: Thu, 11 Jan 2024 21:08:01 +0100 Subject: [PATCH] [BUGFIX] ignore pages.l18n_cfg of translated posts when searching for translations When creating new translation, TYPO3 sets this field to the same value as the translation source, so nothing can be found for pages.l18n_cfg == 2 ("Hide page if no translation for current language exists"). --- Classes/Domain/Repository/PostRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/PostRepository.php b/Classes/Domain/Repository/PostRepository.php index 84fab51c..c82ac1ad 100644 --- a/Classes/Domain/Repository/PostRepository.php +++ b/Classes/Domain/Repository/PostRepository.php @@ -270,7 +270,7 @@ public function findCurrentPost(): ?Post protected function getPostWithLanguage(int $pageId, int $languageId): ?Post { $query = $this->createQuery(); - $constraints = $this->defaultConstraints; + $constraints[] = $query->equals('doktype', Constants::DOKTYPE_BLOG_POST); if ($languageId > 0) { $constraints[] = $query->equals('l10n_parent', $pageId);