From c090746541a4dd4ebe6d50f910f631892f259bae Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 9 Aug 2012 13:48:56 +0100 Subject: [PATCH] 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. --- question/edit.php | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/question/edit.php b/question/edit.php index 411cb3790ab..58fe57c2e52 100644 --- a/question/edit.php +++ b/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();