Permalink
Browse files

MDL-32245 question bank: update URL after moving question between cat…

…egories.

Also, improve the URL when you go to edit the questions in a category.
  • Loading branch information...
1 parent a8ccdd2 commit 94c5a8fe821482b97480d313aa1c3a87e5c8c855 @timhunt timhunt committed with Sam Hemelryk Dec 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 question/category_class.php
@@ -100,7 +100,7 @@ public function item_html($extraargs = array()){
$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 = "<b><a title=\"{$str->edit}\" href=\"$catediturl\">" .
format_string($category->name, true, array('context' => $this->parentlist->context)) .
@@ -456,6 +456,8 @@ public function update_category($updateid, $newparent, $newname, $newinfo) {
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);
}
}

0 comments on commit 94c5a8f

Please sign in to comment.