Skip to content
Snippets Groups Projects
Commit 310e12da authored by Dominik Beyer's avatar Dominik Beyer
Browse files

[BUGFIX] Fix missing related news on translated pages

parent c9bc03d8
No related branches found
No related tags found
1 merge request!52Bugfix related news
......@@ -541,11 +541,12 @@ class NewsRepository extends AbstractRepository {
*
* @param News $news The news to find related news to
* @param int $limit Limit the amount of related news
* @param int $languageUid The language uid for which related news should be searched
* @return QueryResultInterface
* @throws \Doctrine\DBAL\Driver\Exception
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function findRelated(News $news, int $limit = 0): QueryResultInterface {
public function findRelated(News $news, int $limit = 0, int $languageUid = 0): QueryResultInterface {
$connection = $this->getConnection();
$qb = $connection->createQueryBuilder();
// We need to build the constraint for the tags/categories
......@@ -590,6 +591,7 @@ class NewsRepository extends AbstractRepository {
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setLanguageUid($languageUid);
$query->setOrderings([
'lastUpdated' => QueryInterface::ORDER_DESCENDING
]);
......
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