Fixed API error when adding missing products to the shopping list from a meal plan entry (references #b0d38b87de)

This commit is contained in:
Bernd Bestel 2021-07-10 19:56:35 +02:00
parent 003aea6047
commit 9b37c450ed
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -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))