This would be throwing an exception - also it isn't an error situation
$contact['email_greeting'] = $contact['email_greeting_display'] ?? '';
$contact['postal_greeting'] = $contact['postal_greeting_display'] ?? '';
$contact['addressee'] = $contact['address_display'] ?? '';
- if (!$contact || is_a($contact, 'CRM_Core_Error')) {
- // FIXME: Need to differentiate errors which kill the batch vs the individual row.
- \Civi::log()->debug('Failed to generate token data. Invalid contact ID: ' . $row->context['contactId']);
- continue;
- }
//update value of custom field token
if (!empty($messageTokens['contact'])) {