X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FAddress.php;h=5b8331ec6029ba27b00689eb25bc6237adca9e33;hb=f03972e2efe0c6a08842c4d3005fd2147ad32d78;hp=6e1eb1c61bde0394580a293bad3897a55946e6f0;hpb=d28afbc83e18209f5d2bd00841c632054e774003;p=civicrm-core.git diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 6e1eb1c61b..5b8331ec60 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -59,7 +59,7 @@ class CRM_Utils_Address { $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]"; } @@ -141,8 +141,8 @@ class CRM_Utils_Address { '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, @@ -194,7 +194,7 @@ class CRM_Utils_Address { // also sub all token fields if ($tokenFields) { foreach ($tokenFields as $token) { - $replacements["{$token}"] = CRM_Utils_Array::value("{$token}", $fields); + $replacements["{$token}"] = $fields["{$token}"] ?? NULL; } } @@ -320,7 +320,7 @@ class CRM_Utils_Address { $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])) {