diff --git a/changelog/66_UNRELEASED_xxxx-xx-xx.md b/changelog/66_UNRELEASED_xxxx-xx-xx.md index 089b454b..0c973196 100644 --- a/changelog/66_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/66_UNRELEASED_xxxx-xx-xx.md @@ -8,4 +8,5 @@ - Fixed that the logout button/menu was missing when using external authentication (e.g. LDAP) - Fixed that the consume page/dialog wasn't properly initialized when opening it from the stock entries page - Fixed that entries for not existing users were missing on the stock journal +- Fixed that when having a Task without a due date, the iCal export was broken - The API endpoint `/stock/shoppinglist/clear` has now a new optional request body parameter `done_only` (to only remove done items from the given shopping list, defaults to `false`) diff --git a/controllers/CalendarApiController.php b/controllers/CalendarApiController.php index ae4e624d..e5196d14 100644 --- a/controllers/CalendarApiController.php +++ b/controllers/CalendarApiController.php @@ -26,7 +26,7 @@ class CalendarApiController extends BaseApiController foreach ($events as $event) { - if (!isset($event['start'])) + if (!isset($event['start']) || empty($event['start'])) { continue; } diff --git a/services/CalendarService.php b/services/CalendarService.php index 373a3649..c8aad8ef 100644 --- a/services/CalendarService.php +++ b/services/CalendarService.php @@ -16,7 +16,6 @@ class CalendarService extends BaseService public function GetEvents() { $stockEvents = []; - if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) { $products = $this->getDatabase()->products(); @@ -37,7 +36,6 @@ class CalendarService extends BaseService } $taskEvents = []; - if (GROCY_FEATURE_FLAG_TASKS) { $titlePrefix = $this->getLocalizationService()->__t('Task due') . ': '; @@ -54,11 +52,9 @@ class CalendarService extends BaseService } $choreEvents = []; - if (GROCY_FEATURE_FLAG_CHORES) { $users = $this->getUsersService()->GetUsersAsDto(); - $chores = $this->getDatabase()->chores()->where('active = 1'); $titlePrefix = $this->getLocalizationService()->__t('Chore due') . ': '; @@ -67,7 +63,6 @@ class CalendarService extends BaseService $chore = FindObjectInArrayByPropertyValue($chores, 'id', $currentChoreEntry->chore_id); $assignedToText = ''; - if (!empty($currentChoreEntry->next_execution_assigned_to_user_id)) { $assignedToText = ' (' . $this->getLocalizationService()->__t('assigned to %s', FindObjectInArrayByPropertyValue($users, 'id', $currentChoreEntry->next_execution_assigned_to_user_id)->display_name) . ')'; @@ -84,7 +79,6 @@ class CalendarService extends BaseService } $batteryEvents = []; - if (GROCY_FEATURE_FLAG_BATTERIES) { $batteries = $this->getDatabase()->batteries()->where('active = 1'); @@ -104,7 +98,6 @@ class CalendarService extends BaseService $mealPlanRecipeEvents = []; $mealPlanNotesEvents = []; $mealPlanProductEvents = []; - if (GROCY_FEATURE_FLAG_RECIPES) { $recipes = $this->getDatabase()->recipes();