From 562cf4d73cc403d502eaa84af455b9757be9ab3c Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 20 Oct 2014 12:19:28 -0700 Subject: [PATCH] CRM-15418 - Prevent non-contact tokens from being lost in replaceGreetingTokens function. ---------------------------------------- * CRM-15418: https://issues.civicrm.org/jira/browse/CRM-15418 --- CRM/Utils/Token.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 0e58f6e12d..10d5d8937f 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1364,12 +1364,14 @@ class CRM_Utils_Token { $escapeSmarty ); } + // check if there are still any unevaluated tokens - $greetingTokens = self::getTokens($tokenString); + $remainingTokens = self::getTokens($tokenString); - // $greetingTokens not empty, there are hook tokens to replace - if (!empty($greetingTokens) ) { + // contact related $greetingTokens not empty, there are customized or hook tokens to replace + if (!empty($remainingTokens['contact']) ) { // Fill the return properties array + $greetingTokens = $remainingTokens['contact']; reset($greetingTokens); $greetingsReturnProperties = array(); while(list($key) = each($greetingTokens)) { -- 2.25.1