diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2020-12-22 08:33:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 08:33:10 +0100 |
commit | a5c55891f5f7002b6dd2892b07e1cbddf57ff708 (patch) | |
tree | 1a9e0eea07be473c7212789e42902d57b98b448b /apps/dav/lib/CalDAV | |
parent | 8e9af2bb56ac73e274fda7013a3f2fcf08717a25 (diff) | |
parent | fd01d2440268f97cb4c2365498688bb29044437d (diff) | |
download | nextcloud-server-a5c55891f5f7002b6dd2892b07e1cbddf57ff708.tar.gz nextcloud-server-a5c55891f5f7002b6dd2892b07e1cbddf57ff708.zip |
Merge pull request #24604 from nextcloud/feat/dav/move-calendar-rename
Allow to force rename a conflicting calendar
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 61fd7d1b0c3..2fecc7affc2 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2741,11 +2741,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $uriName * @param string $uriOrigin * @param string $uriDestination + * @param string $newUriName (optional) the new uriName */ - public function moveCalendar($uriName, $uriOrigin, $uriDestination) { + public function moveCalendar($uriName, $uriOrigin, $uriDestination, $newUriName = null) { $query = $this->db->getQueryBuilder(); $query->update('calendars') ->set('principaluri', $query->createNamedParameter($uriDestination)) + ->set('uri', $query->createNamedParameter($newUriName ?: $uriName)) ->where($query->expr()->eq('principaluri', $query->createNamedParameter($uriOrigin))) ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($uriName))) ->execute(); |