Skip to content

Commit

Permalink
Merge pull request #13284 from aydun/evaluate_fix
Browse files Browse the repository at this point in the history
Prevent \Civi\Token\TokenCompatSubscriber::evaluate() erroring when no contactId is given.
  • Loading branch information
seamuslee001 authored Jan 3, 2019
2 parents 3e66a9d + d4afa03 commit fddfd6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Civi/Token/TokenCompatSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function onEvaluate(TokenValueEvent $e) {
$messageTokens = $e->getTokenProcessor()->getMessageTokens();

foreach ($e->getRows() as $row) {
if (empty($row->context['contactId'])) {
continue;
}
/** @var int $contactId */
$contactId = $row->context['contactId'];
if (empty($row->context['contact'])) {
Expand Down

0 comments on commit fddfd6a

Please sign in to comment.