mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-17469 - Revert incorrect handling of restore parameters in restore.php file. It was
causing restore dates to be rolled based in the course where the backupfile is stored and not in the target course. Merged from 19_STABLE
This commit is contained in:
parent
5758d88262
commit
53fd7cae8d
@ -22,18 +22,6 @@
|
||||
$method = optional_param('method', '', PARAM_ACTION);
|
||||
$backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT);
|
||||
|
||||
//Get and check course
|
||||
if (! $course = $DB->get_record("course", array("id"=>$id))) {
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
// To some reasons, course_startdateoffset value was lost during restoring
|
||||
// See MDL-17469
|
||||
if (!empty($course->startdate) && !empty($SESSION->course_header->course_startdate)) {
|
||||
$SESSION->restore->course_startdateoffset = $course->startdate - $SESSION->course_header->course_startdate;
|
||||
} else {
|
||||
$SESSION->restore->course_startdateoffset = 0;
|
||||
}
|
||||
|
||||
//Check login
|
||||
require_login();
|
||||
|
||||
@ -120,7 +108,12 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//We are here, so me have a file.
|
||||
//We are here, so we have a file.
|
||||
|
||||
//Get and check course
|
||||
if (! $course = $DB->get_record('course', array('id'=>$id))) {
|
||||
error("Course ID was incorrect (can't find it)");
|
||||
}
|
||||
|
||||
//Print header
|
||||
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user