]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17469 - Revert incorrect handling of restore parameters in restore.php file....
authorstronk7 <stronk7>
Mon, 5 Oct 2009 16:32:15 +0000 (16:32 +0000)
committerstronk7 <stronk7>
Mon, 5 Oct 2009 16:32:15 +0000 (16:32 +0000)
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

index b95ced33739759f97110de199ce39fcde6d65597..bc7a27f7852a8e12ec0e53f02470c514f938bf0d 100644 (file)
     $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();
 
         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))) {