From 9b37c450ed7f7dbfbfc231fff4d4793c35fe06c6 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 10 Jul 2021 19:56:35 +0200 Subject: [PATCH] Fixed API error when adding missing products to the shopping list from a meal plan entry (references #https://github.com/grocy/grocy/commit/b0d38b87de07f4ae117dd7e8e437aac2e8d842b1) --- services/RecipesService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/RecipesService.php b/services/RecipesService.php index 44653993..271c95e7 100644 --- a/services/RecipesService.php +++ b/services/RecipesService.php @@ -19,6 +19,11 @@ class RecipesService extends BaseService $recipe = $this->getDataBase()->recipes($recipeId); $recipePositions = $this->GetRecipesPosResolved(); + if ($excludedProductIds == null) + { + $excludedProductIds = []; + } + foreach ($recipePositions as $recipePosition) { if ($recipePosition->recipe_id == $recipeId && !in_array($recipePosition->product_id, $excludedProductIds))