From 1a9d21dc216f919d37c120b5150b2e313c52d1e3 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Fri, 11 Jan 2013 13:07:12 +0800 Subject: [PATCH] MDL-32526 Course: After creating course user should be redirected to newly created course After creating a new course if user has capability to enrol users then enrol user page should be visible else user should see newly created course --- course/edit.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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))); }