Permalink
Browse files

MDL-34807 question bank: navigation loses place.

The symptom is that where we are now is not shown in the settings
navigation. However, the underlying cause is that question/edit.php is
doing some crazy thing of its own to build $PAGE->url, rather than using
the one returned by question_edit_setup.

Not that this patch itentionally removes the returnurl param. It was
added as part of a big change MDL-20276, which I think just got this
detail wrong. That variable is never used.
  • Loading branch information...
1 parent 87e9331 commit 75d86b6fbc1eefe88ef163ab218e6489c5fc04d4 @timhunt committed Aug 9, 2012
Showing with 4 additions and 21 deletions.
  1. +4 −21 question/edit.php
View
25 question/edit.php
@@ -27,32 +27,15 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot . '/question/editlib.php');
-$url = new moodle_url('/question/edit.php');
+list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
+ question_edit_setup('questions', '/question/edit.php');
+
+$url = new moodle_url($thispageurl);
if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
$url->param('lastchanged', $lastchanged);
}
-if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
- $url->param('category', $category);
-}
-if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
- $url->param('qpage', $qpage);
-}
-if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
- $url->param('cat', $cat);
-}
-if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
- $url->param('courseid', $courseid);
-}
-if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
- $url->param('returnurl', $returnurl);
-}
-if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) {
- $url->param('cmid', $cmid);
-}
$PAGE->set_url($url);
-list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
- question_edit_setup('questions', '/question/edit.php');
$questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
$questionbank->process_actions();

0 comments on commit 75d86b6

Please sign in to comment.