Remove over-copied function
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 27 Sep 2021 06:58:29 +0000 (19:58 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 27 Sep 2021 07:04:16 +0000 (20:04 +1300)
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

index 132eff19ffc43dc3eb7db5160dee2c6a33679b42..218b4b3e490dd5473381291ac4caa5c1a0edd107 100644 (file)
@@ -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.
    *