From a8a80afccd1c4d00e079930a4d72e86ca7a9ef90 Mon Sep 17 00:00:00 2001 From: scyrma Date: Tue, 29 Jan 2008 05:48:53 +0000 Subject: [PATCH] Upgrade path for MDL-13060. --- lib/db/upgrade.php | 14 ++++++++++++++ version.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index a3e62aecac0..7473d26ea38 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -71,6 +71,20 @@ function xmldb_main_upgrade($oldversion=0) { } } + if ($result && $oldversion < 2006101041) { + $db->debug = false; + notify('Updating country list according to recent official ISO listing...', 'notifysuccess'); + // re-assign users to valid countries + set_field('user', 'country', 'CD', 'country', 'ZR'); // Zaire is now Congo Democratique + set_field('user', 'country', 'TL', 'country', 'TP'); // Timor has changed + set_field('user', 'country', 'FR', 'country', 'FX'); // France metropolitaine doesn't exist + set_field('user', 'country', 'RS', 'country', 'KO'); // Kosovo is part of Serbia, "under the auspices of the United Nations, pursuant to UN Security Council Resolution 1244 of 10 June 1999." + set_field('user', 'country', 'GB', 'country', 'WA'); // Wales is part of UK (ie Great Britain) + set_field('user', 'country', 'RS', 'country', 'CS'); // Re-assign Serbia-Montenegro to Serbia. This is arbitrary, but there is no way to make an automatic decision on this. + notify('...update complete. Remember to update your language packs to get the most recent country names definitions and codes. This is especially important for sites with users from Congo (now CD), Timor (now TL), Kosovo (now RS), Wales (now GB), Serbia (RS) and Montenegro (ME). Users based in Montenegro (ME) will need to manually update their profile.', 'notifysuccess'); + $db->debug = true; + } + return $result; } diff --git a/version.php b/version.php index bcc9eae1178..6d7f4db966b 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2006101040; // YYYYMMDD = date of the 1.7 branch (don't change) + $version = 2006101041; // YYYYMMDD = date of the 1.7 branch (don't change) // X = release number 1.7.[0,1,2,3...] // Y = micro-increments between releases