From: Eileen McNaughton Date: Mon, 25 Sep 2023 21:17:10 +0000 (+1300) Subject: Remove unreachable code X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ca3c1cb55c43a0bac825a78399883302cd98587d;p=civicrm-core.git Remove unreachable code Mailing is hard-coded to FALSE so anything that relies on it being TRUE is unreachable --- diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 62c5b2a88f..d311828a76 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -32,7 +32,7 @@ class CRM_Utils_Address { * The desired address format. * @param bool $microformat * If true indicates, the address to be built in hcard-microformat standard. - * @param bool $mailing + * @param bool $unused * Should ALWAYS be false. * @param string[] $tokenFields * @@ -44,19 +44,13 @@ class CRM_Utils_Address { $fields, $format = NULL, $microformat = FALSE, - $mailing = FALSE, + $unused = FALSE, $tokenFields = NULL ) { - $mailing = FALSE; if (!$format) { $format = Civi::settings()->get('address_format'); } - - if ($mailing) { - $format = Civi::settings()->get('mailing_format'); - } - $formatted = $format; $fullPostalCode = $fields['postal_code'] ?? NULL; @@ -78,26 +72,6 @@ class CRM_Utils_Address { } } - //CRM-16876 Display countries in all caps when in mailing mode. - if ($mailing && !empty($fields['country'])) { - if (Civi::settings()->get('hideCountryMailingLabels')) { - $domain = CRM_Core_BAO_Domain::getDomain(); - $domainLocation = CRM_Core_BAO_Location::getValues(['contact_id' => $domain->contact_id]); - $domainAddress = $domainLocation['address'][1]; - $domainCountryId = $domainAddress['country_id']; - if ($fields['country'] == CRM_Core_PseudoConstant::country($domainCountryId)) { - $fields['country'] = NULL; - } - else { - //Capitalization display on uppercase to contries with special characters - $fields['country'] = mb_convert_case($fields['country'], MB_CASE_UPPER, "UTF-8"); - } - } - else { - $fields['country'] = mb_convert_case($fields['country'], MB_CASE_UPPER, "UTF-8"); - } - } - if (!$microformat) { // replacements in case of Individual Name Format $replacements = [