From 80ba1c7da7ff8e35cc5f709d25cde848562d4652 Mon Sep 17 00:00:00 2001 From: Sebastian Fey Date: Sun, 10 Jan 2021 11:18:55 +0100 Subject: [PATCH 1/2] Adding only keywords of current user to returned recipe results Signed-off-by: Sebastian Fey --- lib/Db/RecipeDb.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Db/RecipeDb.php b/lib/Db/RecipeDb.php index 02a0b4c51..6729928c4 100755 --- a/lib/Db/RecipeDb.php +++ b/lib/Db/RecipeDb.php @@ -80,7 +80,12 @@ public function findAllRecipes(string $user_id) { ->where('r.user_id = :user') ->orderBy('r.name'); $qb->setParameter('user', $user_id, TYPE::STRING); - $qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k', 'r.recipe_id = k.recipe_id'); + $qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k', + $qb->expr()->andX( + 'r.recipe_id = k.recipe_id', + 'k.user_id = :user' + ) + ); $cursor = $qb->execute(); $result = $cursor->fetchAll(); From c4ba2a9cf53fa87b5ed82f429755c87c871fe22e Mon Sep 17 00:00:00 2001 From: Sebastian Fey Date: Sun, 10 Jan 2021 11:35:26 +0100 Subject: [PATCH 2/2] Updated CHANGELOG Signed-off-by: Sebastian Fey --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa55b554..717efb61b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Fixed +- Fixed keywords of shared recipes counted multiple times, fixes #491 + [#493](https://github.com/nextcloud/cookbook/pull/493/) @seyfeb + ## 0.7.8 - 2021-01-08