Prevent evaluate() erroring when no contactId is given.
authorAidan Saunders <aidan.saunders@squiffle.uk>
Mon, 5 Nov 2018 18:08:32 +0000 (18:08 +0000)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Fri, 14 Dec 2018 15:47:53 +0000 (15:47 +0000)
Civi/Token/TokenCompatSubscriber.php

index 8e2ac735ba1b176cb5216da295183ec7733282b9..b4b41cfdab5b67ad65b28581ac31a6831d8b57f4 100644 (file)
@@ -49,6 +49,9 @@ class TokenCompatSubscriber implements EventSubscriberInterface {
     $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'])) {