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
This commit is contained in:
+2
-10
@@ -130,16 +130,8 @@ if ($editform->is_cancelled()) {
|
||||
}
|
||||
rebuild_course_cache($course->id);
|
||||
|
||||
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)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user