From f4aa1bee4994cec98ce509a0d2d33a3af592fd68 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 10 Jan 2022 15:37:23 +1300 Subject: [PATCH] Use field value function to get html signature The function is used for all other tokens on the contact object and will better access the right value and return an empty string rather NULL if not set. I hit this as an enotice writing a test - but it is possibly the cause of this issue https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/issues/58#issuecomment-966611004 hence targetting the rc The tokens() function does weird things if you pass it NULL --- CRM/Contact/Tokens.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contact/Tokens.php b/CRM/Contact/Tokens.php index 5742945dd3..731b2f330c 100644 --- a/CRM/Contact/Tokens.php +++ b/CRM/Contact/Tokens.php @@ -316,7 +316,7 @@ class CRM_Contact_Tokens extends CRM_Core_EntityTokens { ->tokens('contact', $token, "cs={$cs}"); } elseif ($token === 'signature_html') { - $row->format('text/html')->tokens('contact', $token, html_entity_decode($row->context['contact'][$token])); + $row->format('text/html')->tokens('contact', $token, html_entity_decode($this->getFieldValue($row, $token))); } else { parent::evaluateToken($row, $this->entity, $token, $row->context['contact']); -- 2.25.1