diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 1664f2a0186..2a3fe48f40b 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -962,12 +962,16 @@ class restore_section_structure_step extends restore_structure_step { // Annotate the section mapping, with restorefiles option if needed $this->set_mapping('course_section', $oldid, $newitemid, $restorefiles); + // Commented out. We never modify course->numsections as far as that is used + // by a lot of people to "hide" sections on purpose (so this remains as used to be in Moodle 1.x) + // Note: We keep the code here, to know about and because of the possibility of making this + // optional based on some setting/attribute in the future // If needed, adjust course->numsections - if ($numsections = $DB->get_field('course', 'numsections', array('id' => $this->get_courseid()))) { - if ($numsections < $section->section) { - $DB->set_field('course', 'numsections', $section->section, array('id' => $this->get_courseid())); - } - } + //if ($numsections = $DB->get_field('course', 'numsections', array('id' => $this->get_courseid()))) { + // if ($numsections < $section->section) { + // $DB->set_field('course', 'numsections', $section->section, array('id' => $this->get_courseid())); + // } + //} } protected function after_execute() {