From c0267dc54972e0d82f465ec8a9d8aefd2bd69f3f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 19 Dec 2012 09:31:02 +0000 Subject: [PATCH] MDL-32245 question bank: update URL after moving question between categories. Also, improve the URL when you go to edit the questions in a category. --- question/category_class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/question/category_class.php b/question/category_class.php index 8103e962726..8352bdc1f82 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -100,7 +100,7 @@ class question_category_list_item extends list_item { $editqestions = get_string('editquestions', 'question'); /// Each section adds html to be displayed as part of this list item - $questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('category'=>"$category->id,$category->contextid"))); + $questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('cat'=>"$category->id,$category->contextid"))); $catediturl = $this->parentlist->pageurl->out(true, array('edit' => $this->id)); $item = "edit}\" href=\"$catediturl\">" . format_string($category->name, true, array('context' => $this->parentlist->context)) . @@ -456,6 +456,8 @@ class question_category_object { question_move_category_to_context($cat->id, $oldcat->contextid, $tocontextid); } + // Cat param depends on the context id, so update it. + $this->pageurl->param('cat', $updateid . ',' . $tocontextid); redirect($this->pageurl); } }