Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CRM/Upgrade/Incremental/sql/6.22.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ DELETE `cpp` FROM `civicrm_payment_processor` `cpp`

DELETE FROM `civicrm_payment_processor_type`
WHERE `name` = 'FirstData';

-- Add the constituent countries of the United Kingdom
INSERT IGNORE INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("England", "GB", "1", "0");
INSERT IGNORE INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Scotland", "GB", "1", "0");
INSERT IGNORE INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Wales", "GB", "1", "0");
INSERT IGNORE INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Northern Ireland", "GB", "1", "0");
12 changes: 8 additions & 4 deletions tests/phpunit/CRM/Core/BAO/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1047,17 +1047,21 @@ public function testCountrySorting(): void {
// Åland Islands
$this->assertSame('AX', $countries[1]['name']);
$this->assertSame('AL', $countries[2]['name']);
$this->assertSame('US', $countries[237]['name']);
// Venezuela sorts before Verenigde Staten (United States), unlike in English
$positions = array_flip(array_column($countries, 'name'));
$this->assertLessThan($positions['US'], $positions['VE']);
$this->assertSame('CH', array_pop($countries)['name']);

CRM_Core_I18n::singleton()->setLocale('it_IT');
$countries = \Civi::entity('Address')->getOptions('country_id');
$this->assertSame('AF', $countries[0]['name']);
$this->assertSame('AL', $countries[1]['name']);
$this->assertSame('DZ', $countries[2]['name']);
// Åland Islands
$this->assertSame('AX', $countries[104]['name']);
$this->assertSame('US', $countries[213]['name']);
$positions = array_flip(array_column($countries, 'name'));
// Isole Åland no longer sorts among the A's
$this->assertGreaterThan($positions['DZ'], $positions['AX']);
// Stati Uniti (United States) sorts before Thailandia (Thailand), unlike in English
$this->assertLessThan($positions['TH'], $positions['US']);
$this->assertSame('ZW', array_pop($countries)['name']);
}

Expand Down
4 changes: 4 additions & 0 deletions xml/templates/civicrm_country.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,7 @@ INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1251", "Kosovo", "XK", "1", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1252", "Saint Barthélemy", "BL", "2", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1253", "Saint Martin (French part)", "MF", "2", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1254", "England", "GB", "1", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1255", "Scotland", "GB", "1", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1256", "Wales", "GB", "1", "0");
INSERT INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1257", "Northern Ireland", "GB", "1", "0");