Consider only reminders with calendar data

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-05-01 11:37:50 +02:00
parent c724eb24d5
commit c781e488a6
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 10 additions and 2 deletions

View File

@ -68,8 +68,8 @@ class Backend {
$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(

View File

@ -117,6 +117,10 @@ class ReminderService {
? stream_get_contents($reminder['calendardata'])
: $reminder['calendardata'];
if (!$calendarData) {
continue;
}
$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {
$this->backend->removeReminder($reminder['id']);
@ -190,6 +194,10 @@ class ReminderService {
? stream_get_contents($objectData['calendardata'])
: $objectData['calendardata'];
if (!$calendarData) {
return;
}
/** @var VObject\Component\VCalendar $vcalendar */
$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {