fixes iphone update script
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 20 Jan 2016 15:35:22 +0000 (16:35 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 20 Jan 2016 15:45:25 +0000 (16:45 +0100)
* and catch exceptions in update script when resetting iphones

Change-Id: Ia986417f9fdfda72fd7dd3756046107b63926264
Reviewed-on: http://gerrit.tine20.com/customers/2602
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Setup/Update/Release8.php

index c788940..9479c86 100644 (file)
@@ -244,11 +244,15 @@ class Calendar_Setup_Update_Release8 extends Setup_Update_Abstract
         $deviceBackend = new ActiveSync_Backend_Device();
         $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
             'devicetype' => 'iphone'
         $deviceBackend = new ActiveSync_Backend_Device();
         $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
             'devicetype' => 'iphone'
-        )), NULL, 'owner_id');
+        )))->owner_id;
 
         $activeSyncController = ActiveSync_Controller::getInstance();
         foreach($usersWithiPhones as $userId) {
 
         $activeSyncController = ActiveSync_Controller::getInstance();
         foreach($usersWithiPhones as $userId) {
-            $activeSyncController->resetSyncForUser($userId, 'Calendar');
+            try {
+                $activeSyncController->resetSyncForUser($userId, 'Calendar');
+            } catch (Exception $e) {
+                Tinebase_Exception::log($e, /* suppress trace */ false);
+            }
         }
 
         $this->setApplicationVersion('Calendar', '8.7');
         }
 
         $this->setApplicationVersion('Calendar', '8.7');