diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-03-10 12:23:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 12:23:54 +0100 |
commit | ed746b92b8b8cc11331c8ca80e873ebfd54efa3a (patch) | |
tree | 32e03376ee872df9d1036b1ffdf33054fc87c0ab | |
parent | e2e7427dcad78f6a5b681067185bcaea97a1cb6a (diff) | |
parent | 1503798725e8b7306e610d838695ab7024bd049d (diff) | |
download | nextcloud-server-ed746b92b8b8cc11331c8ca80e873ebfd54efa3a.tar.gz nextcloud-server-ed746b92b8b8cc11331c8ca80e873ebfd54efa3a.zip |
Merge pull request #31263 from nextcloud/backport/20766/stable22
[stable22] Consider only reminders with calendar data
-rw-r--r-- | apps/dav/lib/AppInfo/Application.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/CalDAV/Reminder/Backend.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/CalDAV/Reminder/ReminderService.php | 8 |
3 files changed, 15 insertions, 3 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index 7e26912120a..551ad8ebaa2 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -38,6 +38,7 @@ use OCA\DAV\CalDAV\Activity\Backend; use OCA\DAV\CalDAV\BirthdayService; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\CalendarManager; +use OCA\DAV\CalDAV\Reminder\Backend as ReminderBackend; use OCA\DAV\CalDAV\Reminder\NotificationProvider\AudioProvider; use OCA\DAV\CalDAV\Reminder\NotificationProvider\EmailProvider; use OCA\DAV\CalDAV\Reminder\NotificationProvider\PushProvider; @@ -301,8 +302,11 @@ class Application extends App implements IBootstrap { ]); /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $container->query(CalDavBackend::class); + $calDavBackend = $container->get(CalDavBackend::class); $calDavBackend->purgeAllCachedEventsForSubscription($subscriptionData['id']); + /** @var ReminderBackend $calDavBackend */ + $reminderBackend = $container->get(ReminderBackend::class); + $reminderBackend->cleanRemindersForCalendar((int) $subscriptionData['id']); } ); diff --git a/apps/dav/lib/CalDAV/Reminder/Backend.php b/apps/dav/lib/CalDAV/Reminder/Backend.php index 48b1e9aed46..b0476e9594c 100644 --- a/apps/dav/lib/CalDAV/Reminder/Backend.php +++ b/apps/dav/lib/CalDAV/Reminder/Backend.php @@ -67,8 +67,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( diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index ad5c18d477d..109fc95e9be 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -119,6 +119,10 @@ class ReminderService { ? stream_get_contents($reminder['calendardata']) : $reminder['calendardata']; + if (!$calendarData) { + continue; + } + $vcalendar = $this->parseCalendarData($calendarData); if (!$vcalendar) { $this->backend->removeReminder($reminder['id']); @@ -168,6 +172,10 @@ class ReminderService { ? stream_get_contents($objectData['calendardata']) : $objectData['calendardata']; + if (!$calendarData) { + return; + } + /** @var VObject\Component\VCalendar $vcalendar */ $vcalendar = $this->parseCalendarData($calendarData); if (!$vcalendar) { |