Skip to content

Commit

Permalink
[BUGFIX] Exclude current news in simpleprevnext
Browse files Browse the repository at this point in the history
Resolves: #1389
  • Loading branch information
georgringer committed Jan 12, 2021
1 parent 20e3bdc commit 13e538c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/ViewHelpers/SimplePrevNextViewHelper.php
Expand Up @@ -174,7 +174,9 @@ protected function getNeighbours(News $news, $pidList, $sortField)
foreach (['prev', 'next'] as $label) {
$queryBuilder = $connection->createQueryBuilder();

$extraWhere = [];
$extraWhere = [
$queryBuilder->expr()->neq('uid', $queryBuilder->createNamedParameter($news->getUid(), \PDO::PARAM_INT))
];
if ((bool)$this->arguments['includeInternalType'] === false) {
$extraWhere[] = $queryBuilder->expr()->neq('type', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT));
}
Expand Down

0 comments on commit 13e538c

Please sign in to comment.