Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30569 Administration Fixing the redirect after editting is toggel…

…ed on the front page
  • Loading branch information...
commit ad96cc524b2241f06f273649913df08baa4f053c 1 parent f89a83b
@ankitagarwal ankitagarwal authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 course/view.php
View
14 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()) {
Please sign in to comment.
Something went wrong with that request. Please try again.