From b904130b5b815988b0dbadc70934941a1abd3175 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 5 Mar 2012 02:41:33 +0100 Subject: [PATCH] MDL-27764 restore - always restore as much info as possible (1.9 approach) In 2.0 we had reduced the types of restore operations where we allow to load the section names and section descriptions, only proceeding when restoring to new course or to existing course, deleting. With this patch, we change to the old 1.9 way, that was to restore the section information always, no matter of the type of restore operation (course restore, import, to new or to existing course, deleting or adding). The only exception is that it's always checked that the target section names and descriptions are empty. --- backup/moodle2/restore_section_task.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backup/moodle2/restore_section_task.class.php b/backup/moodle2/restore_section_task.class.php index 4efd4e82987..9d48778fed1 100644 --- a/backup/moodle2/restore_section_task.class.php +++ b/backup/moodle2/restore_section_task.class.php @@ -76,11 +76,9 @@ class restore_section_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 - 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')); - } + // We always try to restore as much info from sections as possible, no matter of the type + // of restore (new, existing, deleting, import...). MDL-27764 + $this->add_step(new restore_section_structure_step('course_info', 'section.xml')); // At the end, mark it as built $this->built = true;