From 53fd7cae8d6a67c8c32f7f69ba0c89e3c20b529a Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 5 Oct 2009 16:32:15 +0000 Subject: [PATCH] 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 --- backup/restore.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/backup/restore.php b/backup/restore.php index b95ced3373..bc7a27f785 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -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))) { -- 2.39.5