Fix caching to not treat an empty array as a cache miss.
authoreileen <emcnaughton@wikimedia.org>
Thu, 6 Sep 2018 04:04:05 +0000 (16:04 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 6 Sep 2018 04:04:05 +0000 (16:04 +1200)
Only NULL is a cache miss....

CRM/Core/PseudoConstant.php

index 5cef5e081eb4aa7da36d8443963f24754d69c2de..c22ec91e29164a6b2e73ec5b607b3941b339ba12 100644 (file)
@@ -539,7 +539,7 @@ class CRM_Core_PseudoConstant {
     $cacheKey = CRM_Core_BAO_Cache::cleanKey("CRM_PC_{$name}_{$all}_{$key}_{$retrieve}_{$filter}_{$condition}_{$orderby}");
     $cache = CRM_Utils_Cache::singleton();
     $var = $cache->get($cacheKey);
-    if ($var && empty($force)) {
+    if ($var !== NULL && empty($force)) {
       return $var;
     }