Skip to content

Commit

Permalink
NOMDL Do not try to rename the moodledata/lang if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Jul 15, 2010
1 parent 9e11d50 commit 2a27240
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/db/upgrade.php
Expand Up @@ -101,11 +101,15 @@ function xmldb_main_upgrade($oldversion) {
if ($oldversion < 2008030602) {
@unlink($CFG->dataroot.'/cache/languages');

// rename old lang directory so that the new and old langs do not mix
if (rename("$CFG->dataroot/lang", "$CFG->dataroot/oldlang")) {
$oldlang = "$CFG->dataroot/oldlang";
if (file_exists("$CFG->dataroot/lang")) {
// rename old lang directory so that the new and old langs do not mix
if (rename("$CFG->dataroot/lang", "$CFG->dataroot/oldlang")) {
$oldlang = "$CFG->dataroot/oldlang";
} else {
$oldlang = "$CFG->dataroot/lang";
}
} else {
$oldlang = "$CFG->dataroot/lang";
$oldlang = '';
}
// TODO: fetch previously installed languages ("*_utf8") found in $oldlang from moodle.org
upgrade_set_timeout(60*20); // this may take a while
Expand Down

0 comments on commit 2a27240

Please sign in to comment.