From 212f042eaf1e4aeb6ac3f43fa85a3748006f052e Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Wed, 21 Dec 2022 12:30:59 +0000
Subject: [PATCH] fix ical-import, closes #680

Closes #680

Merge request studip/studip!1268
---
 lib/calendar/CalendarParser.class.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/calendar/CalendarParser.class.php b/lib/calendar/CalendarParser.class.php
index dac15701961..75780763f78 100644
--- a/lib/calendar/CalendarParser.class.php
+++ b/lib/calendar/CalendarParser.class.php
@@ -102,11 +102,11 @@ class CalendarParser
         $calendar_event->setAccessibility($component['CLASS']);
         $calendar_event->setUserDefinedCategories($component['CATEGORIES']);
         $calendar_event->event->category_intern = $component['STUDIP_CATEGORY'] ?: 1;
-        $calendar_event->setPriority($component['PRIORITY']);
+        $calendar_event->setPriority($component['PRIORITY'] ?? 0);
         $calendar_event->event->location = $component['LOCATION'];
         $calendar_event->setExceptions($component['EXDATE']);
-        $calendar_event->event->mkdate = $component['CREATED'];
-        $calendar_event->event->chdate = $component['LAST-MODIFIED'] ?: $component['CREATED'];
+        $calendar_event->event->mkdate = $component['CREATED'] ?? time();
+        $calendar_event->event->chdate = $component['LAST-MODIFIED'] ?: $component['CREATED'] ?? time();
         $calendar_event->event->importdate = $this->time;
     }
 
-- 
GitLab