Browse files

MDL-27764 restore - always restore as much info as possible (1.9 appr…


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.
  • Loading branch information...
stronk7 committed Mar 5, 2012
1 parent e356fb6 commit dfa28b875d1ef39e6cca8abbc354d330c5b9a34b
Showing with 3 additions and 5 deletions.
  1. +3 −5 backup/moodle2/restore_section_task.class.php
@@ -71,11 +71,9 @@ public function build() {
// 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;

0 comments on commit dfa28b8

Please sign in to comment.