mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Fixed API error when adding missing products to the shopping list from a meal plan entry (references #b0d38b87de
)
This commit is contained in:
@@ -19,6 +19,11 @@ class RecipesService extends BaseService
|
|||||||
$recipe = $this->getDataBase()->recipes($recipeId);
|
$recipe = $this->getDataBase()->recipes($recipeId);
|
||||||
$recipePositions = $this->GetRecipesPosResolved();
|
$recipePositions = $this->GetRecipesPosResolved();
|
||||||
|
|
||||||
|
if ($excludedProductIds == null)
|
||||||
|
{
|
||||||
|
$excludedProductIds = [];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($recipePositions as $recipePosition)
|
foreach ($recipePositions as $recipePosition)
|
||||||
{
|
{
|
||||||
if ($recipePosition->recipe_id == $recipeId && !in_array($recipePosition->product_id, $excludedProductIds))
|
if ($recipePosition->recipe_id == $recipeId && !in_array($recipePosition->product_id, $excludedProductIds))
|
||||||
|
Reference in New Issue
Block a user