Permalink
Browse files

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

…k/moodle into MOODLE_22_STABLE
  • Loading branch information...
danpoltawski committed Dec 17, 2012
2 parents 2a24377 + a6989dc commit 9205de2fd828b748d1992ff03476d1524b1ad526
Showing with 15 additions and 1 deletion.
  1. +14 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
@@ -7247,5 +7247,19 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011120505.09);
}
+ if ($oldversion < 2011120506.06) {
+ // 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, 2011120506.06);
+ }
+
return true;
}
View
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011120506.05; // 20111205 = branching date YYYYMMDD - do not modify!
+$version = 2011120506.06; // 20111205 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit 9205de2

Please sign in to comment.