prevent problem with wrong return data
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Mar 2016 14:32:01 +0000 (15:32 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Mar 2016 15:10:23 +0000 (16:10 +0100)
Change-Id: I86bcb1c4e8ed8ad788a2027c24b4488812c0b79f
Reviewed-on: http://gerrit.tine20.com/customers/2905
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Container.php

index 891bdd6..8d1e512 100644 (file)
@@ -1362,9 +1362,15 @@ class Tinebase_Container extends Tinebase_Backend_Sql_Abstract
         $classCacheId = $accountId . $containerId . $container->seq . $_grantModel;
         
         try {
-            return $this->loadFromClassCache(__FUNCTION__, $classCacheId, Tinebase_Cache_PerRequest::VISIBILITY_SHARED);
+            $grants = $this->loadFromClassCache(__FUNCTION__, $classCacheId, Tinebase_Cache_PerRequest::VISIBILITY_SHARED);
+            if ($grants instanceof Tinebase_Model_Grants) {
+                return $grants;
+            } else {
+                if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ .
+                    ' Invalid data in cache ... fetching fresh data from DB');
+            }
         } catch (Tinebase_Exception_NotFound $tenf) {
-            
+            // not found in cache
         }
         
         $select = $this->_getAclSelectByContainerId($containerId)