catch errors when trying to get "other app etags"
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 2 Sep 2014 15:42:29 +0000 (17:42 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:49 +0000 (11:26 +0200)
Change-Id: Id03c9a0cdbb82a8f760a414308eba27aa87b9f30
Reviewed-on: http://gerrit.tine20.com/customers/1083
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Import/CalDAV/ClientMock.php
tests/tine20/Calendar/Import/CalDAVTest.php
tine20/Calendar/Import/CalDav/Client.php

index 497c2e7..79591e1 100644 (file)
@@ -375,7 +375,7 @@ DTSTAMP:20140602T131725Z
 SEQUENCE:1
 END:VEVENT
 END:VCALENDAR',
-            '{DAV:}getetag' => '"3333914690ad7290fa9a2dc1da490489"',
+            '{DAV:}getetag' => '"-1030341843%40citrixonlinecom"',
         );
     }
     
index f36196e..5371fcc 100644 (file)
@@ -111,7 +111,7 @@ class Calendar_Import_CalDAVTest extends Calendar_TestCase
         $this->assertEquals(4, count($events));
         $expectedEtags = array(
             '"bcc36c611f0b60bfee64b4d42e44aa1d"', // unchanged
-            '"3333914690ad7290fa9a2dc1da490489"', // added on server
+            '"-1030341843%40citrixonlinecom"',    // added on server
             '"aa3621a20e9045d8679075db57e881dd"', // updated
             null,                                 // added on client (tine20)
         );
index 096544c..2b26499 100644 (file)
@@ -479,10 +479,15 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
             : Tinebase_Core::getApplicationInstance('Calendar', 'Calendar_Model_Event')->getBackend();
         
         $containerFilterArray = array('field' => 'container_id', 'operator' => 'equals', 'value' => $otherContainer->getId());
-        $filter = ($this->appName === 'Calendar') 
-            ? new Tasks_Model_TaskFilter(array($containerFilterArray))
-            : new Calendar_Model_EventFilter(array($containerFilterArray));
-        $ids = $otherBackend->search($filter, null, true);
+        try {
+            $filter = ($this->appName === 'Calendar') 
+                ? new Tasks_Model_TaskFilter(array($containerFilterArray))
+                : new Calendar_Model_EventFilter(array($containerFilterArray));
+            $ids = $otherBackend->search($filter, null, true);
+        } catch (Exception $e) {
+            Tinebase_Exception::log($e);
+            return array();
+        }
         return $ids;
     }