Browse Source

Fix loading all principal calendars in the dav app calendar provider

If we load all calendar infos of a principal then we get back an array
and not a single calendar info. This was handled incorrectly and an
array of calendar infos were passed to the calendar implementation,
resulting in interesting bugs.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/29663/head
Christoph Wurst 5 years ago
parent
commit
603a88f2ee
No known key found for this signature in database GPG Key ID: CC42AC2A7F0E56D8
  1. 2
      apps/dav/lib/CalDAV/CalendarProvider.php

2
apps/dav/lib/CalDAV/CalendarProvider.php

@ -49,7 +49,7 @@ class CalendarProvider implements ICalendarProvider {
public function getCalendars(string $principalUri, array $calendarUris = []): array {
$calendarInfos = [];
if (empty($calendarUris)) {
$calendarInfos[] = $this->calDavBackend->getCalendarsForUser($principalUri);
$calendarInfos = $this->calDavBackend->getCalendarsForUser($principalUri);
} else {
foreach ($calendarUris as $calendarUri) {
$calendarInfos[] = $this->calDavBackend->getCalendarByUri($principalUri, $calendarUri);

Loading…
Cancel
Save