Skip to content
Browse files

Merge branch 'w50_MDL-36597_m24_courselang' of git://github.com/skoda…

…k/moodle into MOODLE_24_STABLE
  • Loading branch information...
2 parents 4548df3 + b768c6f commit 973fe984cd51671d87d13f003041241040529c2e @danpoltawski danpoltawski committed Dec 17, 2012
Showing with 15 additions and 1 deletion.
  1. +14 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
14 lib/db/upgrade.php
@@ -1517,5 +1517,19 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120300.01);
}
+ if ($oldversion < 2012120300.04) {
+ // Remove "_utf8" suffix from all langs in course table.
+ $langs = $DB->get_records_sql("SELECT DISTINCT lang FROM {course} WHERE lang LIKE ?", array('%_utf8'));
+
+ foreach ($langs as $lang=>$unused) {
+ $newlang = str_replace('_utf8', '', $lang);
+ $sql = "UPDATE {course} SET lang = :newlang WHERE lang = :lang";
+ $DB->execute($sql, array('newlang'=>$newlang, 'lang'=>$lang));
+ }
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2012120300.04);
+ }
+
return true;
}
View
2 version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012120300.03; // 20121203 = branching date YYYYMMDD - do not modify!
+$version = 2012120300.04; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit 973fe98

Please sign in to comment.
Something went wrong with that request. Please try again.