Merge branch 'wip-mdl-33367' of git://github.com/rajeshtaneja/moodle
[moodle.git] / course / view.php
index 2d4d347..2b6a908 100644 (file)
 
             if (!empty($section)) {
                 if (!empty($move) and confirm_sesskey()) {
-                    if (move_section($course, $section, $move)) {
+                    $destsection = $section + $move;
+                    if (move_section_to($course, $section, $destsection)) {
+                        // Rebuild course cache, after moving section
+                        rebuild_course_cache($course->id, true);
                         if ($course->id == SITEID) {
                             redirect($CFG->wwwroot . '/?redirect=0');
                         } else {