Permalink
Browse files

Merge branch 'MDL-32012_m21' of git://github.com/merrill-oakland/mood…

…le into MOODLE_21_STABLE
  • Loading branch information...
2 parents 817d932 + bf2d7c1 commit 7299a9e288909b8fd773da888a5f6388a89af87f Sam Hemelryk committed May 1, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 mod/resource/backup/moodle1/lib.php
@@ -191,8 +191,17 @@ public function process_resource(array $data, array $raw) {
}
$this->fileman->filearea = 'content';
$this->fileman->itemid = 0;
+
+ // Rebuild the file path.
+ $curfilepath = '/';
+ if ($reference) {
+ $curfilepath = pathinfo('/'.$reference, PATHINFO_DIRNAME);
+ if ($curfilepath != '/') {
+ $curfilepath .= '/';
+ }
+ }
try {
- $this->fileman->migrate_file('course_files/'.$reference, '/', null, 1);
+ $this->fileman->migrate_file('course_files/'.$reference, $curfilepath, null, 1);
} catch (moodle1_convert_exception $e) {
// the file probably does not exist
$this->log('error migrating the resource main file', backup::LOG_WARNING, 'course_files/'.$reference);

0 comments on commit 7299a9e

Please sign in to comment.