fixes recordBackend variable in updateCalendar
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Aug 2014 20:26:15 +0000 (22:26 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:45 +0000 (11:26 +0200)
+ some more logging

Change-Id: I1234c5aaae0e2a2da24016c48025ed889d88a554
Reviewed-on: http://gerrit.tine20.com/customers/1040
Tested-by: Jenkins CI (http://ci.tine20.com/)
Tested-by: Philipp Schüle <p.schuele@metaways.de>
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Import/CalDav/Client.php

index bfea553..08150f8 100644 (file)
@@ -295,8 +295,11 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
         if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
                 . ' Looking for updates in ' . count($this->calendarICSs). ' calendars ...');
         
+        // @todo move to a member variable
+        $recordBackend = Tinebase_Core::getApplicationInstance($this->appName, $this->modelName)->getBackend();
+        
         foreach ($this->calendarICSs as $calUri => $calICSs) {
-            $updateResult = $this->updateCalendar($calUri, $calICSs);
+            $updateResult = $this->updateCalendar($calUri, $calICSs, $recordBackend);
             if (count($updateResult['ics']) > 0) {
                 $newICSs[$calUri] = $updateResult['ics'];
             }
@@ -331,7 +334,7 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
         }
     }
     
-    protected function updateCalendar($calUri, $calICSs)
+    protected function updateCalendar($calUri, $calICSs, $recordBackend)
     {
         $updateResult = array(
             'ics'       => array(),
@@ -343,7 +346,6 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
         $serverEtags = $this->_fetchServerEtags($calUri, $calICSs);
         
         // get current tine20 id/etags of records
-        $recordBackend = Tinebase_Core::getApplicationInstance($this->appName, $this->modelName)->getBackend();
         $defaultCalendarsName = $this->_getDefaultCalendarsName();
         $container = $this->findContainerForCalendar($calUri, $this->calendars[$calUri]['displayname'], $defaultCalendarsName);
         $containerEtags = $recordBackend->getEtagsForContainerId($container->getId());
@@ -510,6 +512,9 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
                         continue;
                     }
                     
+                    if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . ' ' . __LINE__
+                            . ' Processing caldav record: ' . $key);
+                    
                     $name = explode('/', $key);
                     $name = end($name);
                     $id = $this->_getEventIdFromName($name);