NOBUG: Restore section names and descriptions when restoring deleting. Somehow relate...
authorEloy Lafuente <stronk7@moodle.org>
Wed, 15 Sep 2010 10:58:13 +0000 (10:58 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Wed, 15 Sep 2010 10:58:13 +0000 (10:58 +0000)
backup/moodle2/restore_course_task.class.php
backup/moodle2/restore_section_task.class.php

index 9994d1b..7591efb 100644 (file)
@@ -61,7 +61,7 @@ class restore_course_task extends restore_task {
         // Define the task contextid (the course one)
         $this->contextid = get_context_instance(CONTEXT_COURSE, $this->get_courseid())->id;
 
-        // Executed conditionally if restoring to new course or deleting or if overwrite_conf setting is enabled
+        // Executed conditionally if restoring to new course or if overwrite_conf setting is enabled
         if ($this->get_target() == backup::TARGET_NEW_COURSE || $this->get_setting_value('overwrite_conf') == true) {
             $this->add_step(new restore_course_structure_step('course_info', 'course.xml'));
         }
index 454487c..75bf7c3 100644 (file)
@@ -62,7 +62,8 @@ class restore_section_task extends restore_task {
         $this->contextid = get_context_instance(CONTEXT_COURSE, $this->get_courseid())->id;
 
         // Executed conditionally if restoring to new course or deleting or if overwrite_conf setting is enabled
-        if ($this->get_target() == backup::TARGET_NEW_COURSE || $this->get_setting_value('overwrite_conf') == true) {
+        if ($this->get_target() == backup::TARGET_NEW_COURSE || $this->get_target() == backup::TARGET_CURRENT_DELETING ||
+            $this->get_target() == backup::TARGET_EXISTING_DELETING || $this->get_setting_value('overwrite_conf') == true) {
             $this->add_step(new restore_section_structure_step('course_info', 'section.xml'));
         }