From 35eb9767062d09c05c8670e9b298348352609e9e Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Tue, 4 Feb 2020 19:49:09 +0100 Subject: [PATCH] Don't show nested-resolved recipe ingredients of the selected recipe --- changelog/56_UNRELEASED_2020-xx-xx.md | 2 ++ controllers/RecipesController.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog/56_UNRELEASED_2020-xx-xx.md b/changelog/56_UNRELEASED_2020-xx-xx.md index 45fcac28..248cf6e0 100644 --- a/changelog/56_UNRELEASED_2020-xx-xx.md +++ b/changelog/56_UNRELEASED_2020-xx-xx.md @@ -11,6 +11,8 @@ - Variable ingredient amounts are now marked accordingly on the renedered recipe - Fixed that when editing a recipe ingredient which had "Only check if a single unit is in stock" set, not any quantity unit could be picked and the amount stayed empty - Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created +- Fixed that the recipe "fullscreen card" was not correctly displayed +- Fixed that nested recipes showed all ingredients of the nested recipes twice ### Meal plan improvements - Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product diff --git a/controllers/RecipesController.php b/controllers/RecipesController.php index 5d63454a..521d2dd0 100644 --- a/controllers/RecipesController.php +++ b/controllers/RecipesController.php @@ -37,14 +37,14 @@ class RecipesController extends BaseController if (isset($request->getQueryParams()['recipe'])) { $selectedRecipe = $this->Database->recipes($request->getQueryParams()['recipe']); - $selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id', $request->getQueryParams()['recipe'])->orderBy('ingredient_group'); + $selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $request->getQueryParams()['recipe'])->orderBy('ingredient_group'); } else { foreach ($recipes as $recipe) { $selectedRecipe = $recipe; - $selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id', $recipe->id)->orderBy('ingredient_group'); + $selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $recipe->id)->orderBy('ingredient_group'); break; } }