// 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() {