X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FToken%2FTokenCompatSubscriber.php;h=b4b41cfdab5b67ad65b28581ac31a6831d8b57f4;hb=9bda6b7a507b0c43cd1062296c334e7e464cf3ff;hp=d00acd75092236e8466f963130f1b1304ee6ff02;hpb=ec89e245e833295ba9770448ac8913b7c3784ac7;p=civicrm-core.git diff --git a/Civi/Token/TokenCompatSubscriber.php b/Civi/Token/TokenCompatSubscriber.php index d00acd7509..b4b41cfdab 100644 --- a/Civi/Token/TokenCompatSubscriber.php +++ b/Civi/Token/TokenCompatSubscriber.php @@ -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'])) { @@ -90,7 +93,7 @@ class TokenCompatSubscriber implements EventSubscriberInterface { // less randomly. \CRM_Utils_Hook::tokenValues($contactArray, (array) $contactId, - empty($row->context['mailingJob']) ? NULL : $row->context['mailingJob']->id, + empty($row->context['mailingJobId']) ? NULL : $row->context['mailingJobId'], $messageTokens, $row->context['controller'] );