From: Eileen McNaughton Date: Tue, 27 Jul 2021 22:57:30 +0000 (+1200) Subject: Caching fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=17cca51ef8200473ed3867e0bd5bf3ac787673d6;p=civicrm-core.git Caching fixes --- diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 8d065c4021..6e9ea5b403 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1559,7 +1559,7 @@ class CRM_Utils_Token { protected static function _buildContributionTokens() { $key = 'contribution'; - if (self::$_tokens[$key] == NULL) { + if (!isset(Civi::$statics[__CLASS__][__FUNCTION__][$key])) { $processor = new CRM_Contribute_Tokens(); $tokens = array_merge(CRM_Contribute_BAO_Contribution::exportableFields('All'), ['campaign' => [], 'financial_type' => [], 'payment_instrument' => []], @@ -1571,8 +1571,9 @@ class CRM_Utils_Token { $tokens[$token['name']] = []; } } - self::$_tokens[$key] = array_keys($tokens); + Civi::$statics[__CLASS__][__FUNCTION__][$key] = array_keys($tokens); } + self::$_tokens[$key] = Civi::$statics[__CLASS__][__FUNCTION__][$key]; } /**