mirror of
https://github.com/nextcloud/server.git
synced 2026-02-23 09:53:17 -05:00
Merge pull request #47337 from nextcloud/backport/47332/stable29
[stable29] fix(caldav): allow renaming of birthday calendars
This commit is contained in:
commit
35085228dc
3 changed files with 8 additions and 4 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue