From 27864d8ac9b2b4fa7a892cb22569d6054fbd9a4c Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 2 Dec 2015 06:38:37 +1300 Subject: [PATCH] CRM-17644 fix caching on tax rates to still cache if none set Change-Id: I9cbfc19a50e5848fc7ec0a6448929558b3f46fe4 --- CRM/Core/PseudoConstant.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 5135da2aad..1335766dc7 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -179,12 +179,6 @@ class CRM_Core_PseudoConstant { */ private static $accountOptionValues; - /** - * Tax Rates - * @var array - */ - private static $taxRates; - /** * Low-level option getter, rarely accessed directly. * NOTE: Rather than calling this function directly use CRM_*_BAO_*::buildOptions() @@ -1848,8 +1842,8 @@ WHERE id = %1 * array list of tax rates with the financial type */ public static function getTaxRates() { - if (!self::$taxRates) { - self::$taxRates = array(); + if (!isset(Civi::$statics[__CLASS__]['taxRates'])) { + Civi::$statics[__CLASS__]['taxRates'] = array(); $sql = " SELECT fa.tax_rate, efa.entity_id FROM civicrm_entity_financial_account efa @@ -1862,11 +1856,11 @@ WHERE id = %1 AND fa.is_active = 1"; $dao = CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { - self::$taxRates[$dao->entity_id] = $dao->tax_rate; + Civi::$statics[__CLASS__]['taxRates'][$dao->entity_id] = $dao->tax_rate; } } - return self::$taxRates; + return Civi::$statics[__CLASS__]['taxRates']; } } -- 2.25.1