From ad96cc524b2241f06f273649913df08baa4f053c Mon Sep 17 00:00:00 2001 From: Ankit Kumar Agarwal Date: Thu, 15 Dec 2011 08:23:15 +0530 Subject: [PATCH 1/1] MDL-30569 Administration Fixing the redirect after editting is toggeled on the front page --- course/view.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/course/view.php b/course/view.php index 28ed12459f2..a930df34519 100644 --- a/course/view.php +++ b/course/view.php @@ -107,14 +107,24 @@ if ($PAGE->user_allowed_editing()) { if (($edit == 1) and confirm_sesskey()) { $USER->editing = 1; - redirect($PAGE->url); + // Redirect to site root if Editing is toggled on frontpage + if ($course->id == SITEID) { + redirect($CFG->wwwroot .'/?redirect=0'); + } else { + redirect($PAGE->url); + } } else if (($edit == 0) and confirm_sesskey()) { $USER->editing = 0; if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) { $USER->activitycopy = false; $USER->activitycopycourse = NULL; } - redirect($PAGE->url); + // Redirect to site root if Editing is toggled on frontpage + if ($course->id == SITEID) { + redirect($CFG->wwwroot .'/?redirect=0'); + } else { + redirect($PAGE->url); + } } if ($hide && confirm_sesskey()) { -- 2.39.2