Fix caching bug in DAO commit PR
authoreileen <emcnaughton@wikimedia.org>
Thu, 11 Aug 2016 05:07:00 +0000 (17:07 +1200)
committerTim Otten <totten@civicrm.org>
Thu, 11 Aug 2016 20:25:09 +0000 (13:25 -0700)
CRM/Core/BAO/Cache.php

index 7438a8bea74c31ceefa24584fa97ae21362cf34b..1977bf8c4612ea45c7d0217e36986a3c9089a6a0 100644 (file)
@@ -70,9 +70,8 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache {
       if (!self::$_cache[$argString]) {
         $table = self::getTableName();
         $where = self::whereCache($group, $path, $componentID);
-        $dao = CRM_Core_DAO::executeQuery("SELECT data FROM $table WHERE $where");
-        $data = isset($dao->data) ? unserialize($dao->data) : NULL;
-        $dao->free();
+        $rawData = CRM_Core_DAO::singleValueQuery("SELECT data FROM $table WHERE $where");
+        $data = $rawData ? unserialize($rawData) : NULL;
 
         self::$_cache[$argString] = $data;
         $cache->set($argString, self::$_cache[$argString]);