From d29bb5ff9dea555c6de7fbd354195c2f4acbb8bb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 24 May 2022 17:04:56 +0200 Subject: [PATCH 1/2] Fix handling events without names in activities Signed-off-by: Joas Schilling --- apps/dav/lib/CalDAV/Activity/Provider/Event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 96366f5494292..5789a1f220f7e 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -88,9 +88,9 @@ protected function generateObjectParameter(array $eventData) { $params = [ 'type' => 'calendar-event', 'id' => $eventData['id'], - 'name' => $eventData['name'], - + 'name' => $eventData['name'] !== '' ? $eventData['name'] : $this->l->t('Untitled event'), ]; + if (isset($eventData['link']) && is_array($eventData['link']) && $this->appManager->isEnabledForUser('calendar')) { try { // The calendar app needs to be manually loaded for the routes to be loaded From 33d003d032b245688d6ef69d3773ac0fc6fcdc7d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 25 May 2022 08:06:32 +0200 Subject: [PATCH 2/2] Also trim the name Signed-off-by: Joas Schilling --- apps/dav/lib/CalDAV/Activity/Provider/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 5789a1f220f7e..3ed591219af0d 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -88,7 +88,7 @@ protected function generateObjectParameter(array $eventData) { $params = [ 'type' => 'calendar-event', 'id' => $eventData['id'], - 'name' => $eventData['name'] !== '' ? $eventData['name'] : $this->l->t('Untitled event'), + 'name' => trim($eventData['name']) !== '' ? $eventData['name'] : $this->l->t('Untitled event'), ]; if (isset($eventData['link']) && is_array($eventData['link']) && $this->appManager->isEnabledForUser('calendar')) {