Browse Source

Check the calendar type of calendarobjects & calendarchanges

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
tags/v17.0.0beta4
Thomas Citharel 4 years ago
parent
commit
e2b539bebf
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php

+ 6
- 0
apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php View File

@@ -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();

Loading…
Cancel
Save