From: toyomoyo Date: Fri, 20 Oct 2006 02:08:21 +0000 (+0000) Subject: merged, setting $CFG->unicodedb after converting db to unicode. Chaning the order... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=207355b4385d6f4decbd28ace8e4fe6bf91507f3;p=moodle.git merged, setting $CFG->unicodedb after converting db to unicode. Chaning the order of if clause to same some sqls --- diff --git a/lib/ddllib.php b/lib/ddllib.php index 9f76b37fc4..ea316768e9 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -1145,13 +1145,13 @@ function rename_index($table, $index, $newname, $continue=true, $feedback=true) function change_db_encoding() { global $CFG, $db; // try forcing utf8 collation, if mysql db and no tables present - if (!$db->Metatables() && ($CFG->dbtype=='mysql') && empty($CFG->unicodedb)) { + if (empty($CFG->unicodedb) && ($CFG->dbtype=='mysql') && !$db->Metatables()) { $SQL = 'ALTER DATABASE '.$CFG->dbname.' CHARACTER SET utf8'; execute_sql($SQL, false); // silent, if it fails it fails if (setup_is_unicodedb()) { - // set_config('unicodedb','true'); // can not set config because there is no config table yet =( + $CFG->unicodedb = true; configure_dbconnection(); - } + } } }