]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only delete the default calendar setting when the default calendar 19852/head
authorThomas Citharel <tcit@tcit.fr>
Sun, 5 Apr 2020 18:57:26 +0000 (20:57 +0200)
committerThomas Citharel <tcit@tcit.fr>
Mon, 13 Apr 2020 13:07:43 +0000 (15:07 +0200)
itself is deleted

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
apps/dav/lib/AppInfo/Application.php

index c22afa755cbb38633b441ab3a597059a5483276f..d5e3358d96da9c1a7745aaab8ab7bf1210e50d8a 100644 (file)
@@ -255,7 +255,10 @@ class Application extends App {
                        $principalUri = $event->getArgument('calendarData')['principaluri'];
                        if (strpos($principalUri, 'principals/users') === 0) {
                                list(, $UID) = \Sabre\Uri\split($principalUri);
-                               $config->deleteUserValue($UID, 'dav', 'defaultCalendar');
+                               $uri = $event->getArgument('calendarData')['uri'];
+                               if ($config->getUserValue($UID, 'dav', 'defaultCalendar') === $uri) {
+                                       $config->deleteUserValue($UID, 'dav', 'defaultCalendar');
+                               }
                        }
                });
        }