aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2022-02-18 15:52:33 +0100
committerGitHub <noreply@github.com>2022-02-18 15:52:33 +0100
commit6e0101b59c3942a3f6cd148da18c89bf2d33120d (patch)
treeea2e0ed1ca1d1cb11f4e0a3712a090ce0087cb0a /apps
parent280cc47a86d88edfdeaca82f5ccd41c7f7232b1d (diff)
parent22f8c42f06fd923ba204fe64c623c30974483e1a (diff)
downloadnextcloud-server-6e0101b59c3942a3f6cd148da18c89bf2d33120d.tar.gz
nextcloud-server-6e0101b59c3942a3f6cd148da18c89bf2d33120d.zip
Merge pull request #20766 from nextcloud/bug/fix-reminders-with-empty-calendar-data
Consider only reminders with calendar data
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/AppInfo/Application.php4
-rw-r--r--apps/dav/lib/CalDAV/Reminder/Backend.php4
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php8
3 files changed, 14 insertions, 2 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index a2fd645ab8a..e25b63b598e 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -39,6 +39,7 @@ use OCA\DAV\CalDAV\BirthdayService;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\CalendarManager;
use OCA\DAV\CalDAV\CalendarProvider;
+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;
@@ -306,6 +307,9 @@ class Application extends App implements IBootstrap {
/** @var CalDavBackend $calDavBackend */
$calDavBackend = $container->query(CalDavBackend::class);
$calDavBackend->purgeAllCachedEventsForSubscription($subscriptionData['id']);
+ /** @var ReminderBackend $calDavBackend */
+ $reminderBackend = $container->query(ReminderBackend::class);
+ $reminderBackend->cleanRemindersForCalendar($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) {