MDL-32508 course/view.php: action cleanup
authorDan Poltawski <dan@moodle.com>
Sat, 28 Apr 2012 05:47:02 +0000 (13:47 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 4 May 2012 02:52:58 +0000 (10:52 +0800)
After doing actions redirect back to the 'real url' in order to
prevent problems with caching/bookmarking bad urls

course/view.php

index 7c39a1d..ea6e3ca 100644 (file)
         if (has_capability('moodle/course:update', $context)) {
             if ($hide && confirm_sesskey()) {
                 set_section_visible($course->id, $hide, '0');
+                redirect($PAGE->url);
             }
 
             if ($show && confirm_sesskey()) {
                 set_section_visible($course->id, $show, '1');
+                redirect($PAGE->url);
             }
 
             if (!empty($section)) {
                         if ($course->id == SITEID) {
                             redirect($CFG->wwwroot . '/?redirect=0');
                         } else {
-                            redirect($PAGE->url);
+                            redirect(course_get_url($course));
                         }
                     } else {
                         echo $OUTPUT->notification('An error occurred while moving a section');