Skip to content

Commit

Permalink
Consider only reminders with calendar data
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld authored and backportbot[bot] committed Feb 18, 2022
1 parent de9e61a commit 219ede7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Reminder/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function getRemindersToProcess():array {
$query->select(['cr.*', 'co.calendardata', 'c.displayname', 'c.principaluri'])
->from('calendar_reminders', 'cr')
->where($query->expr()->lte('cr.notification_date', $query->createNamedParameter($this->timeFactory->getTime())))
->leftJoin('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
->leftJoin('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
->join('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
$stmt = $query->execute();

return array_map(
Expand Down
8 changes: 8 additions & 0 deletions apps/dav/lib/CalDAV/Reminder/ReminderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function processReminders():void {
? stream_get_contents($reminder['calendardata'])
: $reminder['calendardata'];

if (!$calendarData) {
continue;
}

$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {
$this->backend->removeReminder($reminder['id']);
Expand Down Expand Up @@ -168,6 +172,10 @@ public function onCalendarObjectCreate(array $objectData):void {
? stream_get_contents($objectData['calendardata'])
: $objectData['calendardata'];

if (!$calendarData) {
return;
}

/** @var VObject\Component\VCalendar $vcalendar */
$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {
Expand Down

0 comments on commit 219ede7

Please sign in to comment.