]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed important bug when recovering assignments or forums
authorstronk7 <stronk7>
Mon, 28 Jul 2003 22:31:23 +0000 (22:31 +0000)
committerstronk7 <stronk7>
Mon, 28 Jul 2003 22:31:23 +0000 (22:31 +0000)
with files and the moddata/courseid didn't exist.
Now force the creation of the courseid dir from the
restorelib in each module.

mod/assignment/restorelib.php
mod/forum/restorelib.php

index 5282666ab2c0a96033c362eaff86a69ef82e8d28..55ce60e65ba25a44487ffa924819ab07b127e251 100644 (file)
         $assignment_path = "";
         $temp_path = "";
 
-        //First, locate course's moddata directory
+        //First, we check to "course_id" exists and create is as necessary
+        //in CFG->dataroot
+        $dest_dir = $CFG->dataroot."/".$restore->course_id;
+        $status = check_dir_exists($dest_dir,true);
+
+        //Now, locate course's moddata directory
         $moddata_path = $CFG->dataroot."/".$restore->course_id."/".$CFG->moddata;
    
         //Check it exists and create it
index 2ea5960a69425ff61a69c5b87b7f858839e02680..8b06931b2eec94d27fab970defc3a42bb658a8c3 100644 (file)
         $forum_path = "";
         $temp_path = "";
 
+        //First, we check to "course_id" exists and create is as necessary
+        //in CFG->dataroot
+        $dest_dir = $CFG->dataroot."/".$restore->course_id;
+        $status = check_dir_exists($dest_dir,true);
+
         //First, locate course's moddata directory
         $moddata_path = $CFG->dataroot."/".$restore->course_id."/".$CFG->moddata;