Skip to content

Commit 9428e22

Browse files
authored
Merge c4ba2a9 into 4bdd8b4
2 parents 4bdd8b4 + c4ba2a9 commit 9428e22

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## [Unreleased]
22

3+
### Fixed
4+
- Fixed keywords of shared recipes counted multiple times, fixes #491
5+
[#493](https://github.com/nextcloud/cookbook/pull/493/) @seyfeb
6+
37

48
## 0.7.8 - 2021-01-08
59

lib/Db/RecipeDb.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ public function findAllRecipes(string $user_id) {
8080
->where('r.user_id = :user')
8181
->orderBy('r.name');
8282
$qb->setParameter('user', $user_id, TYPE::STRING);
83-
$qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k', 'r.recipe_id = k.recipe_id');
83+
$qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k',
84+
$qb->expr()->andX(
85+
'r.recipe_id = k.recipe_id',
86+
'k.user_id = :user'
87+
)
88+
);
8489

8590
$cursor = $qb->execute();
8691
$result = $cursor->fetchAll();

0 commit comments

Comments
 (0)