]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure there is a calendar after delete.
authorThomas Tanghus <thomas@tanghus.net>
Fri, 15 Jun 2012 00:10:55 +0000 (02:10 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Fri, 15 Jun 2012 00:10:55 +0000 (02:10 +0200)
apps/calendar/lib/calendar.php

index cde020293d4843f53350bf7d59642fcee4fae51d..0a54e7a32a6cd40a5010bd3eba91ff12c97bb0de 100644 (file)
@@ -198,6 +198,10 @@ class OC_Calendar_Calendar{
                $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE calendarid = ?' );
                $stmt->execute(array($id));
 
+               if(count(self::allCalendars()) == 0) {
+                       self::addCalendar(OCP\USER::getUser(),'Default calendar');
+               }
+
                return true;
        }