Make sure there is a calendar after delete.

remotes/origin/stable45
Thomas Tanghus 13 years ago
parent 3c75ac5f62
commit f6aa366857
  1. 4
      apps/calendar/lib/calendar.php

@ -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;
}

Loading…
Cancel
Save