From 81d7d3312750892f74a0fdc69cc7a12e27310eb1 Mon Sep 17 00:00:00 2001 From: fipwmaqzufheoxq92ebc <29818044+fipwmaqzufheoxq92ebc@users.noreply.github.com> Date: Sat, 12 Sep 2020 13:09:59 +0200 Subject: [PATCH] Fix possibly undefined variables in CalendarService.php --- services/CalendarService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/CalendarService.php b/services/CalendarService.php index 11f19c0b..f90dab17 100644 --- a/services/CalendarService.php +++ b/services/CalendarService.php @@ -95,6 +95,8 @@ class CalendarService extends BaseService } $mealPlanRecipeEvents = []; + $mealPlanNotesEvents = []; + $mealPlanProductEvents = []; if (GROCY_FEATURE_FLAG_RECIPES) { @@ -120,7 +122,7 @@ class CalendarService extends BaseService $mealPlanDayNotes = $this->getDatabase()->meal_plan()->where('type', 'note'); $titlePrefix = $this->getLocalizationService()->__t('Meal plan note') . ': '; - $mealPlanNotesEvents = []; + foreach ($mealPlanDayNotes as $mealPlanDayNote) { @@ -134,7 +136,7 @@ class CalendarService extends BaseService $products = $this->getDatabase()->products(); $mealPlanDayProducts = $this->getDatabase()->meal_plan()->where('type', 'product'); $titlePrefix = $this->getLocalizationService()->__t('Meal plan product') . ': '; - $mealPlanProductEvents = []; + foreach ($mealPlanDayProducts as $mealPlanDayProduct) {