diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 571fb6dace63..1d5bb178ae6f 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -25,6 +25,7 @@ use Exception; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\DAV\GroupPrincipalBackend; +use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Reader; @@ -108,7 +109,8 @@ public function ensureCalendarExists($principal) { $this->calDavBackEnd->createCalendar($principal, self::BIRTHDAY_CALENDAR_URI, [ '{DAV:}displayname' => 'Contact birthdays', '{http://apple.com/ns/ical/}calendar-color' => '#FFFFCA', - 'components' => 'VEVENT', + '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VEVENT']), + '{http://apple.com/ns/ical/}calendar-order' => 100 ]); return $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 7f051426c368..e74d88f3b0a1 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -349,6 +349,7 @@ public function getCalendarById($calendarId) { * @param string $calendarUri * @param array $properties * @return int + * @throws DAV\Exception */ function createCalendar($principalUri, $calendarUri, array $properties) { $values = [ diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index de066fdf8741..7720177373bf 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -26,6 +26,7 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\DAV\GroupPrincipalBackend; +use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Reader; use Test\TestCase; @@ -184,7 +185,8 @@ public function testBirthdayCalendarHasComponentEvent() { ->with('principal001', 'contact_birthdays', [ '{DAV:}displayname' => 'Contact birthdays', '{http://apple.com/ns/ical/}calendar-color' => '#FFFFCA', - 'components' => 'VEVENT', + '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VEVENT']), + '{http://apple.com/ns/ical/}calendar-order' => 100 ]); $this->service->ensureCalendarExists('principal001'); }