fill atendee cache only when needed
authorLars Kneschke <l.kneschke@metaways.de>
Sun, 14 Dec 2014 18:26:29 +0000 (19:26 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 15 Dec 2014 11:12:56 +0000 (12:12 +0100)
Change-Id: Id99d8d3ee139ca7857d6b9df6ef0ecf42d6291f2
Reviewed-on: http://gerrit.tine20.com/customers/1444
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Controller/MSEventFacade.php

index e6f2543..888bd24 100644 (file)
@@ -743,11 +743,9 @@ class Calendar_Controller_MSEventFacade implements Tinebase_Controller_Record_In
         if (! $event->attendee instanceof Tinebase_Record_RecordSet) {
             return;
         }
-
-        $this->_fillResolvedAttendeeCache($event);
         
         foreach ($event->attendee as $attender) {
-            $cacheId = $attender['user_type'] . $attender['user_id'];
+            $cacheId = $attender->user_type . $attender->user_id;
             
             // value is in array and true
             if (isset(self::$_attendeeEmailCache[$cacheId])) {
@@ -756,6 +754,8 @@ class Calendar_Controller_MSEventFacade implements Tinebase_Controller_Record_In
             
             // add value to cache if not existing already
             if (!array_key_exists($cacheId, self::$_attendeeEmailCache)) {
+                $this->_fillResolvedAttendeeCache($event);
+                
                 self::$_attendeeEmailCache[$cacheId] = !!$attender->getEmail();
                 
                 // limit class cache to 100 entries