From e32b22a8728c50c61cc9b339064ddd6aa2b59855 Mon Sep 17 00:00:00 2001 From: Patrick Fischer Date: Mon, 24 Jul 2023 13:49:40 +0200 Subject: [PATCH] Bug fix: Select the correct table based on CALENDAR_TYPE_CALENDAR --- apps/dav/lib/CalDAV/CalDavBackend.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index a948c54ad5829..30694ac395f88 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2277,11 +2277,13 @@ public function getCalendarObjectById(string $principalUri, int $id): ?array { * @return array */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType = self::CALENDAR_TYPE_CALENDAR) { - return $this->atomic(function () use ($calendarId, $syncToken, $syncLevel, $limit, $calendarType) { + $table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions'; + + return $this->atomic(function () use ($calendarId, $syncToken, $syncLevel, $limit, $calendarType, $table) { // Current synctoken $qb = $this->db->getQueryBuilder(); $qb->select('synctoken') - ->from('calendars') + ->from($table) ->where( $qb->expr()->eq('id', $qb->createNamedParameter($calendarId)) );