) {
static $config = NULL;
- if (!$format) {
- $format = Civi::settings()->get('address_format');
- }
-
- if ($mailing) {
- $format = Civi::settings()->get('mailing_format');
- }
+ $format = Civi::settings()->get('mailing_format');
$formatted = $format;
}
//CRM-16876 Display countries in all caps when in mailing mode.
- if ($mailing && !empty($fields['country'])) {
+ if (!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]);
$addressDetails = $address['values'][$address['id']];
$countries = CRM_Core_PseudoConstant::country();
$addressDetails['country'] = $countries[$addressDetails['country_id']];
- $formatted_address = CRM_Utils_Address::formatMailingLabel($addressDetails, 'mailing_format', FALSE, TRUE);
+ $formatted_address = CRM_Utils_Address::formatMailingLabel($addressDetails);
$this->assertTrue((bool) strstr($formatted_address, 'UNITED STATES'));
}