modlog: fix xprops access to tinebase application state
authorPaul Mehrer <p.mehrer@metaways.de>
Tue, 11 Jul 2017 11:18:33 +0000 (13:18 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 11 Jul 2017 13:00:06 +0000 (15:00 +0200)
Change-Id: I8c37374b7c8f68e59facefe6c5c5a61f8d3661ea
Reviewed-on: http://gerrit.tine20.com/customers/5091
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Timemachine/ModificationLog.php

index 9f5a4d9..6aaac62 100644 (file)
@@ -1328,7 +1328,7 @@ class Tinebase_Timemachine_ModificationLog implements Tinebase_Controller_Interf
                     static::defaultApply($modification, $controller);
                 }
 
-                $tinebaseApplication->xprops['state'][Tinebase_Model_Application::STATE_REPLICATION_MASTER_ID] =
+                $tinebaseApplication->xprops('state')[Tinebase_Model_Application::STATE_REPLICATION_MASTER_ID] =
                     $modification->instance_seq;
                 $tinebaseApplication = $applicationController->updateApplication($tinebaseApplication);
 
@@ -1405,16 +1405,12 @@ class Tinebase_Timemachine_ModificationLog implements Tinebase_Controller_Interf
         $applicationController = Tinebase_Application::getInstance();
         $tinebase = $applicationController->getApplicationByName('Tinebase');
 
-        $state = $tinebase->state;
-        if (!is_array($state)) {
-            $state = array();
-        }
+        $state = $tinebase->xprops('state');
         if (!isset($state[Tinebase_Model_Application::STATE_REPLICATION_MASTER_ID])) {
             $state[Tinebase_Model_Application::STATE_REPLICATION_MASTER_ID] = 0;
         }
 
         $state[Tinebase_Model_Application::STATE_REPLICATION_MASTER_ID] += intval($count);
-        $tinebase->state = $state;
 
         $applicationController->updateApplication($tinebase);
     }