Merge branch 'wip-mdl-32526-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_...
authorDan Poltawski <dan@moodle.com>
Tue, 22 Jan 2013 06:00:42 +0000 (14:00 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 22 Jan 2013 06:00:42 +0000 (14:00 +0800)
course/edit.php

index 60f9cce..3d4c6b4 100644 (file)
@@ -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)));
 }