From 7d388cca688a6a9817ff451118758c551f4779ba Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 27 Sep 2021 19:58:29 +1300 Subject: [PATCH] Remove over-copied function In the splitting out of Contact_Tokens from TokenSillyAbreviationSubscriber I copied over this function - but it was an incorrect duplication - it is not called --- CRM/Contact/Tokens.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/CRM/Contact/Tokens.php b/CRM/Contact/Tokens.php index 132eff19ff..218b4b3e49 100644 --- a/CRM/Contact/Tokens.php +++ b/CRM/Contact/Tokens.php @@ -11,7 +11,6 @@ */ use Civi\Token\Event\TokenRegisterEvent; -use Civi\Token\Event\TokenRenderEvent; use Civi\Token\Event\TokenValueEvent; use Civi\Token\TokenProcessor; use Civi\Token\TokenRow; @@ -443,33 +442,6 @@ class CRM_Contact_Tokens extends CRM_Core_EntityTokens { return $this->fieldMetadata; } - /** - * Apply the various CRM_Utils_Token helpers. - * - * @param \Civi\Token\Event\TokenRenderEvent $e - */ - public function onRender(TokenRenderEvent $e): void { - $useSmarty = !empty($e->context['smarty']); - $e->string = $e->getTokenProcessor()->visitTokens($e->string, function() { - // For historical consistency, we filter out unrecognized tokens. - return ''; - }); - - if ($useSmarty) { - $smartyVars = []; - foreach ($e->context['smartyTokenAlias'] ?? [] as $smartyName => $tokenName) { - $smartyVars[$smartyName] = \CRM_Utils_Array::pathGet($e->row->tokens, explode('.', $tokenName)); - } - \CRM_Core_Smarty::singleton()->pushScope($smartyVars); - try { - $e->string = \CRM_Utils_String::parseOneOffStringThroughSmarty($e->string); - } - finally { - \CRM_Core_Smarty::singleton()->popScope(); - } - } - } - /** * Get the contact for the row. * -- 2.25.1