diff --git a/course/edit.php b/course/edit.php index 22bdd57fa89..91f28ed27ff 100644 --- a/course/edit.php +++ b/course/edit.php @@ -135,16 +135,8 @@ if ($editform->is_cancelled()) { update_course($data, $editoroptions); } - switch ($returnto) { - case 'category': - case 'topcat': //redirecting to where the new course was created by default. - $url = new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$categoryid)); - break; - default: - $url = new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)); - break; - } - redirect($url); + // Redirect user to newly created/updated course. + redirect(new moodle_url('/course/view.php', array('id' => $course->id))); }