Exclude tasks without an due date from the iCal export (fixes #1745)

This commit is contained in:
Bernd Bestel 2022-01-11 20:54:23 +01:00
parent ec75779bf3
commit 8ec0d9319b
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 2 additions and 8 deletions

View File

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

View File

@ -26,7 +26,7 @@ class CalendarApiController extends BaseApiController
foreach ($events as $event)
{
if (!isset($event['start']))
if (!isset($event['start']) || empty($event['start']))
{
continue;
}

View File

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