Skip to content

Commit

Permalink
[BUGFIX] Fix language sensitivity of getCurrentPost (#47)
Browse files Browse the repository at this point in the history
Resolves: #14
Releases: master, 9.1, 9.0
  • Loading branch information
susannemoog authored and NeoBlack committed Apr 17, 2019
1 parent ed6b09a commit 1ba7068
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Domain/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ public function findCurrentPost(): ?Post
if ($storagePidConstraint instanceof ComparisonInterface) {
$constraints[] = $storagePidConstraint;
}
$constraints[] = $query->equals('uid', $pageId);
if ((int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('language', 'id', 0) > 0) {
$constraints[] = $query->equals('l10n_parent', $pageId);
} else {
$constraints[] = $query->equals('uid', $pageId);
}

/** @var Post $post */
$post = $query
Expand Down

0 comments on commit 1ba7068

Please sign in to comment.