0011572: Unable to update Calendar 9.3 -> 9.4
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Jan 2016 09:05:53 +0000 (10:05 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Jan 2016 10:46:38 +0000 (11:46 +0100)
* need to check if ActiveSync is installed in Calendar update

https://forge.tine20.org/view.php?id=11572

Change-Id: Ie5b2d0157f0a2ed9c8dfc9fc509d38cbf590f511
Reviewed-on: http://gerrit.tine20.com/customers/2611
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Setup/Update/Release8.php

index 9479c86..97e3374 100644 (file)
@@ -241,17 +241,19 @@ class Calendar_Setup_Update_Release8 extends Setup_Update_Abstract
      */
     public function update_6()
     {
      */
     public function update_6()
     {
-        $deviceBackend = new ActiveSync_Backend_Device();
-        $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
-            'devicetype' => 'iphone'
-        )))->owner_id;
+        if (Tinebase_Application::getInstance()->isInstalled('ActiveSync')) {
+            $deviceBackend = new ActiveSync_Backend_Device();
+            $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
+                'devicetype' => 'iphone'
+            )))->owner_id;
 
 
-        $activeSyncController = ActiveSync_Controller::getInstance();
-        foreach($usersWithiPhones as $userId) {
-            try {
-                $activeSyncController->resetSyncForUser($userId, 'Calendar');
-            } catch (Exception $e) {
-                Tinebase_Exception::log($e, /* suppress trace */ false);
+            $activeSyncController = ActiveSync_Controller::getInstance();
+            foreach ($usersWithiPhones as $userId) {
+                try {
+                    $activeSyncController->resetSyncForUser($userId, 'Calendar');
+                } catch (Exception $e) {
+                    Tinebase_Exception::log($e, /* suppress trace */ false);
+                }
             }
         }
 
             }
         }