From: Eileen McNaughton Date: Wed, 1 Sep 2021 07:15:59 +0000 (+1200) Subject: dev/core#2806 Fix accidental exposure of v4 tokens X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c2f1897e0569ac238f79b535d3232358e60d7591;p=civicrm-core.git dev/core#2806 Fix accidental exposure of v4 tokens --- diff --git a/CRM/Core/EntityTokens.php b/CRM/Core/EntityTokens.php index 6ded3ebec5..9a9497ebfa 100644 --- a/CRM/Core/EntityTokens.php +++ b/CRM/Core/EntityTokens.php @@ -321,7 +321,12 @@ class CRM_Core_EntityTokens extends AbstractTokenSubscriber { public function getBasicTokens(): array { $return = []; foreach ($this->getExposedFields() as $fieldName) { - $return[$fieldName] = $this->getFieldMetadata()[$fieldName]['title']; + // Custom fields are still added v3 style - we want to keep v4 naming 'unpoluted' + // for now to allow us to consider how to handle names vs labels vs values + // and other raw vs not raw options. + if ($this->getFieldMetadata()[$fieldName]['type'] !== 'Custom') { + $return[$fieldName] = $this->getFieldMetadata()[$fieldName]['title']; + } } return $return; }