Skip to content

Commit 5d7e5bd

Browse files
committed
[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").
1 parent ce2dc48 commit 5d7e5bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Classes/Domain/Repository/PostRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public function initializeObject(): void
5757
$query->equals('l18n_cfg', 0),
5858
$query->equals('l18n_cfg', 2)
5959
);
60-
} else {
61-
$this->defaultConstraints[] = $query->lessThan('l18n_cfg', 2);
6260
}
6361

6462
$this->defaultOrderings = [
@@ -270,7 +268,9 @@ public function findCurrentPost(): ?Post
270268
protected function getPostWithLanguage(int $pageId, int $languageId): ?Post
271269
{
272270
$query = $this->createQuery();
273-
$constraints = $this->defaultConstraints;
271+
$constraints = [
272+
$query->equals('doktype', Constants::DOKTYPE_BLOG_POST)
273+
];
274274

275275
if ($languageId > 0) {
276276
$constraints[] = $query->equals('l10n_parent', $pageId);

0 commit comments

Comments
 (0)