MDL-26546 Workshop: fixed incorrect mapping name in the restore of assessment forms
authorDavid Mudrak <david@moodle.com>
Mon, 21 Feb 2011 23:54:13 +0000 (00:54 +0100)
committerDavid Mudrak <david@moodle.com>
Mon, 21 Feb 2011 23:54:13 +0000 (00:54 +0100)
There was a regression of 8fa86f and ac0f8f where I changed the mapping
names but did not use the new names in add_related_files() call.

All credit goes to Eloy Lafuente for spotting the problem and giving me
a hint on how to fix it.

mod/workshop/form/accumulative/backup/moodle2/restore_workshopform_accumulative_subplugin.class.php
mod/workshop/form/comments/backup/moodle2/restore_workshopform_comments_subplugin.class.php
mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php
mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php

index 69e56c9..dc2418b 100644 (file)
@@ -112,7 +112,7 @@ class restore_workshopform_accumulative_subplugin extends restore_subplugin {
         $this->set_mapping($this->get_namefor('dimension'), $oldid, $newitemid, true);
 
         // Process files for this workshopform_accumulative->id only
-        $this->add_related_files('workshopform_accumulative', 'description', 'workshopform_accumulative', null, $oldid);
+        $this->add_related_files('workshopform_accumulative', 'description', $this->get_namefor('dimension'), null, $oldid);
     }
 
     /**
index 8374ef0..d72d72d 100644 (file)
@@ -109,7 +109,7 @@ class restore_workshopform_comments_subplugin extends restore_subplugin {
         $this->set_mapping($this->get_namefor('dimension'), $oldid, $newitemid, true);
 
         // Process files for this workshopform_comments->id only
-        $this->add_related_files('workshopform_comments', 'description', 'workshopform_comments', null, $oldid);
+        $this->add_related_files('workshopform_comments', 'description', $this->get_namefor('dimension'), null, $oldid);
     }
 
     /**
index 33a19c2..ce81fcb 100644 (file)
@@ -124,7 +124,7 @@ class restore_workshopform_numerrors_subplugin extends restore_subplugin {
         $this->set_mapping($this->get_namefor('dimension'), $oldid, $newitemid, true);
 
         // Process files for this workshopform_numerrors->id only
-        $this->add_related_files('workshopform_numerrors', 'description', 'workshopform_numerrors', null, $oldid);
+        $this->add_related_files('workshopform_numerrors', 'description', $this->get_namefor('dimension'), null, $oldid);
     }
 
     /**
index 472af01..35b4000 100644 (file)
@@ -128,7 +128,7 @@ class restore_workshopform_rubric_subplugin extends restore_subplugin {
         $this->set_mapping($this->get_namefor('dimension'), $oldid, $newitemid, true);
 
         // Process files for this workshopform_rubric->id only
-        $this->add_related_files('workshopform_rubric', 'description', 'workshopform_rubric', null, $oldid);
+        $this->add_related_files('workshopform_rubric', 'description', $this->get_namefor('dimension'), null, $oldid);
     }
 
     /**