Skip to content

Commit

Permalink
Use field value function to get html signature
Browse files Browse the repository at this point in the history
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
eileenmcnaughton/nz.co.fuzion.civitoken#58 (comment)

hence targetting the rc

The tokens() function does weird things if you pass it NULL
  • Loading branch information
eileenmcnaughton committed Jan 10, 2022
1 parent cc684ff commit f4aa1be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contact/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function onEvaluate(TokenValueEvent $e) {
->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']);
Expand Down

0 comments on commit f4aa1be

Please sign in to comment.