summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPatrick Fischer <mail@patrickfischer.ch>2023-07-24 13:49:40 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-02-23 16:18:01 +0100
commit0f16153e4a52f9fceb80dac19318b2cf881db6e6 (patch)
tree226bc6d3b26ccd7ef9b9ef341759af99368e106f /apps
parentb0b4c7e042b4ea8348d8179744cff1ab643c9d00 (diff)
downloadnextcloud-server-0f16153e4a52f9fceb80dac19318b2cf881db6e6.tar.gz
nextcloud-server-0f16153e4a52f9fceb80dac19318b2cf881db6e6.zip
Bug fix: Select the correct table based on CALENDAR_TYPE_CALENDAR
Signed-off-by: Patrick Fischer <mail@patrickfischer.ch>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 23812ff7e10..78441dc4118 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -2347,11 +2347,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @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))
);