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>
This commit is contained in:
Christoph Wurst 2021-11-11 13:26:53 +01:00
parent 92d4844e0b
commit 603a88f2ee
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8

View file

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