catches access denied exception when updating contract data
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 29 Apr 2015 15:29:40 +0000 (17:29 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 29 Apr 2015 16:04:13 +0000 (18:04 +0200)
Change-Id: I437ae026526db2c14c2aac3a70499ebe4b024139
Reviewed-on: http://gerrit.tine20.com/customers/1897
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Sales/Setup/Update/Release8.php

index e0890f1..f437b2f 100644 (file)
@@ -91,7 +91,6 @@ class Sales_Setup_Update_Release8 extends Setup_Update_Abstract
         $adminGroup   = Tinebase_Group::getInstance()->getDefaultAdminGroup();
         $groupMembers = Tinebase_Group::getInstance()->getGroupMembers($adminGroup->getId());
         
-        
         if (count($groupMembers) > 0) {
             $user = Tinebase_User::getInstance()->getUserById($groupMembers[0]);
             Tinebase_Core::set(Tinebase_Core::USER, $user);
@@ -181,9 +180,14 @@ class Sales_Setup_Update_Release8 extends Setup_Update_Abstract
                 }
             }
             
-            foreach($controller->getMultiple(array_keys($updateDescription)) as $contr) {
-                $contr->description = $updateDescription[$contr->getId()];
-                $controller->update($contr, FALSE);
+            try {
+                foreach ($controller->getMultiple(array_keys($updateDescription)) as $contr) {
+                    $contr->description = $updateDescription[$contr->getId()];
+                    $controller->update($contr, FALSE);
+                }
+            } catch (Tinebase_Exception_AccessDenied $tead) {
+                // could not update contracts ...
+                Tinebase_Exception::log($tead);
             }
         }