$formatted = $format;
- $fullPostalCode = CRM_Utils_Array::value('postal_code', $fields);
+ $fullPostalCode = $fields['postal_code'] ?? NULL;
if (!empty($fields['postal_code_suffix'])) {
$fullPostalCode .= "-$fields[postal_code_suffix]";
}
'contact.contact_source' => $fields['contact_source'] ?? NULL,
'contact.external_identifier' => $fields['external_identifier'] ?? NULL,
'contact.contact_id' => $fields['id'] ?? NULL,
- 'contact.household_name' => $fields['display_name'] ?? NULL,
- 'contact.organization_name' => $fields['display_name'] ?? NULL,
+ 'contact.household_name' => $fields['household_name'] ?? NULL,
+ 'contact.organization_name' => $fields['organization_name'] ?? NULL,
'contact.legal_name' => $fields['legal_name'] ?? NULL,
'contact.preferred_communication_method' => $fields['preferred_communication_method'] ?? NULL,
'contact.communication_style' => $fields['communication_style'] ?? NULL,
// also sub all token fields
if ($tokenFields) {
foreach ($tokenFields as $token) {
- $replacements["{$token}"] = CRM_Utils_Array::value("{$token}", $fields);
+ $replacements["{$token}"] = $fields["{$token}"] ?? NULL;
}
}
$addressFields = [];
foreach ($addressParts as $name => $field) {
- $value = CRM_Utils_Array::value($field, $params);
+ $value = $params[$field] ?? NULL;
$alternateName = 'billing_' . $name . '_id-' . $billingLocationTypeID;
$alternate2 = 'billing_' . $name . '-' . $billingLocationTypeID;
if (isset($params[$alternate2]) && !isset($params[$alternateName])) {