Skip to content

Commit c781e48

Browse files
committed
Consider only reminders with calendar data
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
1 parent c724eb2 commit c781e48

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/dav/lib/CalDAV/Reminder/Backend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function getRemindersToProcess():array {
6868
$query->select(['cr.*', 'co.calendardata', 'c.displayname', 'c.principaluri'])
6969
->from('calendar_reminders', 'cr')
7070
->where($query->expr()->lte('cr.notification_date', $query->createNamedParameter($this->timeFactory->getTime())))
71-
->leftJoin('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
72-
->leftJoin('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
71+
->join('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
72+
->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
7373
$stmt = $query->execute();
7474

7575
return array_map(

apps/dav/lib/CalDAV/Reminder/ReminderService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function processReminders():void {
117117
? stream_get_contents($reminder['calendardata'])
118118
: $reminder['calendardata'];
119119

120+
if (!$calendarData) {
121+
continue;
122+
}
123+
120124
$vcalendar = $this->parseCalendarData($calendarData);
121125
if (!$vcalendar) {
122126
$this->backend->removeReminder($reminder['id']);
@@ -190,6 +194,10 @@ private function onCalendarObjectCreate(array $objectData):void {
190194
? stream_get_contents($objectData['calendardata'])
191195
: $objectData['calendardata'];
192196

197+
if (!$calendarData) {
198+
return;
199+
}
200+
193201
/** @var VObject\Component\VCalendar $vcalendar */
194202
$vcalendar = $this->parseCalendarData($calendarData);
195203
if (!$vcalendar) {

0 commit comments

Comments
 (0)