Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ensure outerquery ->where() function doesn't clobber earier ->andWhere()
Signed-off-by: Jamie McClelland <[email protected]>
  • Loading branch information
jmcclelland authored and AndyScherzinger committed Aug 10, 2023
commit b025e67d8d9763a266ccc21997e753badb626d3e
8 changes: 4 additions & 4 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,10 @@ public function search(array $calendarInfo, $pattern, array $searchProperties,
->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',
Expand All @@ -1866,10 +1870,6 @@ public function search(array $calendarInfo, $pattern, array $searchProperties,
$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',
Expand Down