aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie McClelland <jm@mayfirst.org>2023-08-07 13:35:08 -0400
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-10 07:52:04 +0000
commit1bc8feb33223a8e154aa4c877828fefb85042eec (patch)
tree6b3e6409dba80c009ccf0b800fd3f1851118b8be
parent4f898b9b36c20ad0959b0a3a2c1569a3ca32b6f6 (diff)
downloadnextcloud-server-1bc8feb33223a8e154aa4c877828fefb85042eec.tar.gz
nextcloud-server-1bc8feb33223a8e154aa4c877828fefb85042eec.zip
ensure outerquery ->where() function doesn't clobber earier ->andWhere()
Signed-off-by: Jamie McClelland <jm@mayfirst.org>
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 8b1e3ac6ea9..8df8bbb7d03 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -1824,6 +1824,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->andWhere($innerQuery->expr()->eq('op.calendartype',
$outerQuery->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
+ $outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
+ ->from('calendarobjects', 'c')
+ ->where($outerQuery->expr()->isNull('deleted_at'));
+
// only return public items for shared calendars for now
if (isset($calendarInfo['{http://owncloud.org/ns}owner-principal']) === false || $calendarInfo['principaluri'] !== $calendarInfo['{http://owncloud.org/ns}owner-principal']) {
$outerQuery->andWhere($outerQuery->expr()->eq('c.classification',
@@ -1845,10 +1849,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$this->db->escapeLikeParameter($pattern) . '%')));
}
- $outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
- ->from('calendarobjects', 'c')
- ->where($outerQuery->expr()->isNull('deleted_at'));
-
if (isset($options['timerange'])) {
if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTimeInterface) {
$outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence',