MDL-18469 restore missing session info - add a quick re-test of xml file
before any further processing by restore_execute(). More coming. Merged from 19_STABLE
This commit is contained in:
+15
-3
@@ -8089,6 +8089,19 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
//Location of the xml file
|
||||
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
|
||||
|
||||
// Re-assure xml file is in place before any further process
|
||||
if (! $status = restore_check_moodle_file($xml_file)) {
|
||||
if (!is_file($xml_file)) {
|
||||
$errorstr = 'Error checking backup file. moodle.xml not found. Session problem?';
|
||||
} else {
|
||||
$errorstr = 'Error checking backup file. moodle.xml is incorrect or corrupted. Session problem?';
|
||||
}
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo $OUTPUT->notification($errorstr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Preprocess the moodle.xml file spliting into smaller chucks (modules, users, logs...)
|
||||
//for optimal parsing later in the restore process.
|
||||
if (!empty($CFG->experimentalsplitrestore)) {
|
||||
@@ -8097,10 +8110,9 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
}
|
||||
//First of all, split moodle.xml into handy files
|
||||
if (!restore_split_xml ($xml_file, $restore)) {
|
||||
$errorstr = "Error proccessing moodle.xml file. Process ended.";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo $OUTPUT->notification("Error proccessing moodle.xml file. Process ended.");
|
||||
} else {
|
||||
$errorstr = "Error proccessing moodle.xml file. Process ended.";
|
||||
echo $OUTPUT->notification($errorstr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user