mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Bug #5352 - upgrade might be interrupted by user - upgrades are now logged into moddata/upgradelogs/, user abor is ignored and concurrent running of upgrades is prevented from one browser
This commit is contained in:
parent
0c23b59c9b
commit
583fad994c
7 changed files with 173 additions and 10 deletions
|
@ -327,12 +327,14 @@
|
|||
'<script type="text/javascript" src="' . $CFG->wwwroot . '/lib/scroll_to_errors.js"></script>',
|
||||
false, " ", " ");
|
||||
|
||||
upgrade_log_start();
|
||||
$db->debug=true;
|
||||
if (modify_database("$CFG->dirroot/backup/db/$CFG->dbtype.sql")) {
|
||||
$db->debug = false;
|
||||
if (set_config("backup_version", $backup_version) and set_config("backup_release", $backup_release)) {
|
||||
notify(get_string("databasesuccess"), "green");
|
||||
notify(get_string("databaseupgradebackups", "", $backup_version));
|
||||
upgrade_log_finish();
|
||||
print_continue($continueto);
|
||||
exit;
|
||||
} else {
|
||||
|
@ -349,6 +351,7 @@
|
|||
print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades, '',
|
||||
'<script type="text/javascript" src="' . $CFG->wwwroot . '/lib/scroll_to_errors.js"></script>');
|
||||
|
||||
upgrade_log_start();
|
||||
require_once ("$CFG->dirroot/backup/db/$CFG->dbtype.php");
|
||||
|
||||
$db->debug=true;
|
||||
|
@ -357,6 +360,7 @@
|
|||
if (set_config("backup_version", $backup_version) and set_config("backup_release", $backup_release)) {
|
||||
notify(get_string("databasesuccess"), "green");
|
||||
notify(get_string("databaseupgradebackups", "", $backup_version));
|
||||
upgrade_log_finish();
|
||||
print_continue($continueto);
|
||||
exit;
|
||||
} else {
|
||||
|
@ -368,8 +372,10 @@
|
|||
}
|
||||
|
||||
} else if ($backup_version < $CFG->backup_version) {
|
||||
upgrade_log_start();
|
||||
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue