diff --git a/lib/Db/CardMapper.php b/lib/Db/CardMapper.php index 9e8c3bfd0..a5d5c6f03 100644 --- a/lib/Db/CardMapper.php +++ b/lib/Db/CardMapper.php @@ -171,7 +171,7 @@ public function queryCardsByBoard(int $boardId): IQueryBuilder { public function queryCardsByBoards(array $boardIds): IQueryBuilder { $qb = $this->db->getQueryBuilder(); - $qb->select('c.*') + $qb->selectDistinct('c.*') ->from('deck_cards', 'c') ->innerJoin('c', 'deck_stacks', 's', $qb->expr()->eq('s.id', 'c.stack_id')) ->andWhere($qb->expr()->in('s.board_id', $qb->createNamedParameter($boardIds, IQueryBuilder::PARAM_INT_ARRAY))); @@ -339,7 +339,6 @@ public function search(array $boardIds, SearchQuery $query, int $limit = null, i ); } - $qb->groupBy('c.id'); $qb->orderBy('c.last_modified', 'DESC'); if ($limit !== null) { $qb->setMaxResults($limit); @@ -383,7 +382,6 @@ public function searchComments(array $boardIds, SearchQuery $query, int $limit = $tokenMatching ); - $qb->groupBy('comments.id', 'c.id'); $qb->orderBy('comments.id', 'DESC'); if ($limit !== null) { $qb->setMaxResults($limit);