Permalink
Browse files

Fixed important bug when recovering assignments or forums

with files and the moddata/courseid didn't exist.
Now force the creation of the courseid dir from the
restorelib in each module.
  • Loading branch information...
1 parent 67805f8 commit c45f0ee1ccb10f6e858a0f287f8c3aa42878ace9 stronk7 committed Jul 28, 2003
Showing with 11 additions and 1 deletion.
  1. +6 −1 mod/assignment/restorelib.php
  2. +5 −0 mod/forum/restorelib.php
@@ -166,7 +166,12 @@ function assignment_restore_files ($oldassid, $newassid, $olduserid, $newuserid,
$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
@@ -329,6 +329,11 @@ function forum_restore_files ($oldforid, $newforid, $oldpostid, $newpostid, $res
$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;

0 comments on commit c45f0ee

Please sign in to comment.