diff options
author | Thomas Citharel <tcit@tcit.fr> | 2019-08-22 15:49:51 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2019-08-26 10:41:55 +0200 |
commit | e2b539bebf53e0823d6561fbfde6f660ebc416ab (patch) | |
tree | b5526c6bd5e94d8779d77a80f01fcab340283f52 /apps/dav/lib | |
parent | 456fb7e2940f3c49de3fad0c26230452d2196f49 (diff) | |
download | nextcloud-server-e2b539bebf53e0823d6561fbfde6f660ebc416ab.tar.gz nextcloud-server-e2b539bebf53e0823d6561fbfde6f660ebc416ab.zip |
Check the calendar type of calendarobjects & calendarchanges
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php index 7d995ff35cd..3b5b7bc8ac7 100644 --- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php +++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php @@ -75,6 +75,12 @@ class RemoveOrphanEventsAndContacts implements IRepairStep { ->from($childTable, 'c') ->leftJoin('c', $parentTable, 'p', $qb->expr()->eq('c.' . $parentId, 'p.id')) ->where($qb->expr()->isNull('p.id')); + + if (\in_array($parentTable, ['calendars', 'calendarsubscriptions'], true)) { + $calendarType = $parentTable === 'calendarsubscriptions' ? CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION : CalDavBackend::CALENDAR_TYPE_CALENDAR; + $qb->andWhere($qb->expr()->eq('c.calendartype', $qb->createNamedParameter($calendarType, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT)); + } + $result = $qb->execute(); $orphanItems = array(); |