MDL-32184 - Course - Fixing incorrect redirect when toggling course edit while inside an activity – Patch provided by Kanika Goyal
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
$move = optional_param('move', 0, PARAM_INT);
|
||||
$marker = optional_param('marker',-1 , PARAM_INT);
|
||||
$switchrole = optional_param('switchrole',-1, PARAM_INT);
|
||||
$return = optional_param('return', 0, PARAM_LOCALURL);
|
||||
|
||||
if (empty($id) && empty($name) && empty($idnumber)) {
|
||||
print_error('unspecifycourseid', 'error');
|
||||
@@ -122,6 +123,8 @@
|
||||
// Redirect to site root if Editing is toggled on frontpage
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot .'/?redirect=0');
|
||||
} else if (!empty($return)) {
|
||||
redirect($CFG->wwwroot . $return);
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
@@ -3177,7 +3177,7 @@ class settings_navigation extends navigation_node {
|
||||
|
||||
if (has_capability('moodle/course:update', $coursecontext)) {
|
||||
// Add the turn on/off settings
|
||||
$url = new moodle_url('/course/view.php', array('id'=>$course->id, 'sesskey'=>sesskey()));
|
||||
$url = new moodle_url('/course/view.php', array('id'=>$course->id, 'return'=>str_replace($CFG->wwwroot, '', $this->page->url->out(false)), 'sesskey'=>sesskey()));
|
||||
if ($this->page->user_is_editing()) {
|
||||
$url->param('edit', 'off');
|
||||
$editstring = get_string('turneditingoff');
|
||||
|
||||
Reference in New Issue
Block a user