+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
*/
/**
$returnBlankToken = FALSE,
$escapeSmarty = FALSE
) {
- $key = 'contact';
- if (self::$_tokens[$key] == NULL) {
- // This should come from UF
-
- self::$_tokens[$key]
- = array_merge(
- array_keys(CRM_Contact_BAO_Contact::exportableFields('All')),
- array('checksum', 'contact_id')
- );
- }
+ // Refresh contact tokens in case they have changed. There is heavy caching
+ // in exportable fields so there is no benefit in doing this conditionally.
+ self::$_tokens['contact'] = array_merge(
+ array_keys(CRM_Contact_BAO_Contact::exportableFields('All')),
+ array('checksum', 'contact_id')
+ );
+ $key = 'contact';
// here we intersect with the list of pre-configured valid tokens
// so that we remove anything we do not recognize
// I hope to move this step out of here soon and