fix attendee grid
authorMichael Spahn <m.spahn@metaways.de>
Mon, 24 Jul 2017 10:08:43 +0000 (12:08 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Mon, 24 Jul 2017 10:04:32 +0000 (12:04 +0200)
Change-Id: I6ae8c15c02fcde8528771384cac452db93c2e74e
Reviewed-on: http://gerrit.tine20.com/customers/5285
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Calendar/Frontend/Json.php

index e607f34..1a3ae0f 100644 (file)
@@ -539,8 +539,10 @@ class Calendar_Frontend_Json extends Tinebase_Frontend_Json_Abstract
      * @param array $ignoreUIDs
      * @return array single fbInfo or array of eventid => fbinfo
      */
-    public function getFreeBusyInfo($attendee, $events, $ignoreUIDs = array())
+    public function getFreeBusyInfo($attendee, $events = [], $ignoreUIDs = array())
     {
+        $events = array_filter($events);
+
         $attendee = new Tinebase_Record_RecordSet('Calendar_Model_Attender', $attendee);
         $calendarController = Calendar_Controller_Event::getInstance();
         $fbInfo = [];
@@ -549,6 +551,10 @@ class Calendar_Frontend_Json extends Tinebase_Frontend_Json_Abstract
             $eventRecord = new Calendar_Model_Event(array(), TRUE);
             $eventRecord->setFromJsonInUsersTimezone($event);
 
+            if ($eventRecord->dtstart === null) {
+                continue;
+            }
+
             $periods = $calendarController->getBlockingPeriods($eventRecord, array(
                 'from'  => $eventRecord->dtstart,
                 'until' => $eventRecord->dtstart->getClone()->addMonth(2)