diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-09-05 11:32:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 11:32:58 +0200 |
commit | 35085228dc14afa08ea99a13b3f4d95ca75dbcf2 (patch) | |
tree | b43804f40feb67e32dfecea233e8a2995eae4531 /apps | |
parent | 33d6aac06a92647a912bf24e23b49ca7ac5130b9 (diff) | |
parent | 8f838b2fe8a349d4537384d95b25dacf51f6ac30 (diff) | |
download | nextcloud-server-35085228dc14afa08ea99a13b3f4d95ca75dbcf2.tar.gz nextcloud-server-35085228dc14afa08ea99a13b3f4d95ca75dbcf2.zip |
Merge pull request #47337 from nextcloud/backport/47332/stable29
[stable29] fix(caldav): allow renaming of birthday calendars
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarTest.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/Command/DeleteCalendarTest.php | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index fbfbdf652ec..97580ab4420 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -66,7 +66,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable parent::__construct($caldavBackend, $calendarInfo); - if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) { + if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI && strcasecmp($this->calendarInfo['{DAV:}displayname'], 'Contact birthdays') === 0) { $this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays'); } if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI && diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index 68e6e5ef251..56bd78a2c31 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -135,6 +135,7 @@ class CalendarTest extends TestCase { 'principaluri' => 'principals/users/user1', 'id' => 666, 'uri' => 'contact_birthdays', + '{DAV:}displayname' => 'Test', ]; $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); @@ -204,6 +205,7 @@ class CalendarTest extends TestCase { 'id' => 666, 'uri' => $uri ]; + $calendarInfo['{DAV:}displayname'] = 'Test'; if (!is_null($readOnlyValue)) { $calendarInfo['{http://owncloud.org/ns}read-only'] = $readOnlyValue; } diff --git a/apps/dav/tests/unit/Command/DeleteCalendarTest.php b/apps/dav/tests/unit/Command/DeleteCalendarTest.php index 1c499dbcc25..3b666546bac 100644 --- a/apps/dav/tests/unit/Command/DeleteCalendarTest.php +++ b/apps/dav/tests/unit/Command/DeleteCalendarTest.php @@ -142,7 +142,7 @@ class DeleteCalendarTest extends TestCase { $calendar = [ 'id' => $id, 'principaluri' => 'principals/users/' . self::USER, - 'uri' => self::NAME + 'uri' => self::NAME, ]; $this->userManager->expects($this->once()) @@ -203,7 +203,8 @@ class DeleteCalendarTest extends TestCase { $calendar = [ 'id' => $id, 'principaluri' => 'principals/users/' . self::USER, - 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI + 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI, + '{DAV:}displayname' => 'Test', ]; $this->userManager->expects($this->once()) @@ -232,7 +233,8 @@ class DeleteCalendarTest extends TestCase { $calendar = [ 'id' => 1234, 'principaluri' => 'principals/users/' . self::USER, - 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI + 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI, + '{DAV:}displayname' => 'Test', ]; $this->userManager->expects($this->once()) ->method('userExists') |