Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 3fc3fcd33335efb2c9ab7c3ed7956c0222b43d9a 1 parent 3e90b10
@rajeshtaneja rajeshtaneja authored
Showing with 2 additions and 10 deletions.
  1. +2 −10 course/edit.php
View
12 course/edit.php
@@ -135,16 +135,8 @@
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)));
}
Please sign in to comment.
Something went wrong with that request. Please try again.