modlog: metadata might not be available
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 7 Sep 2016 16:43:27 +0000 (18:43 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 12 Sep 2016 17:16:47 +0000 (19:16 +0200)
... adds an additional check to make sure we have
 user & time

Change-Id: Ic492fcb81a02d3f2696d165b9435ecd6ee42f4a2
Reviewed-on: http://gerrit.tine20.com/customers/3563
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Timemachine/ModificationLog.php

index c279572..654bedf 100644 (file)
@@ -703,7 +703,7 @@ class Tinebase_Timemachine_ModificationLog
      */
     protected function _getCommonModlog($_model, $_backend, $_updateMetaData = array(), $_recordId = NULL)
     {
-        if (empty($_updateMetaData)) {
+        if (empty($_updateMetaData) || ! isset($_updateMetaData['last_modified_by']) ||  ! isset($_updateMetaData['last_modified_time'])) {
             list($currentAccountId, $currentTime) = Tinebase_Timemachine_ModificationLog::getCurrentAccountIdAndTime();
         } else {
             $currentAccountId = $_updateMetaData['last_modified_by'];