From a18fbcfb50fc650b76f7456f64741fd949c5134e Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Tue, 5 Feb 2008 12:14:46 +0000 Subject: [PATCH] MDL-13298 "Question bank displays always page 1 after adding new question" this was caused because the question creation page was redirecting back to the question back edit page and telling it to change to the category of the question that was just saved. This was causing the edit page to go back to page 0 of the new category. Now we only go back to page 0 if the category has actually changed. Merged from MOODLE_19_STABLE --- question/editlib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/question/editlib.php b/question/editlib.php index 1ce4e08550..2f5c45c153 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -637,8 +637,10 @@ function question_edit_setup($edittab, $requirecmid = false, $requirecourseid = //a new cat. $pagevars['cat'] = optional_param('cat', 0, PARAM_SEQUENCE);// if empty will be set up later if ($category = optional_param('category', 0, PARAM_SEQUENCE)){ - $pagevars['cat'] = $category; - $pagevars['qpage'] = 0; + if ($pagevars['cat'] != $category){ // is this a move to a new category? + $pagevars['cat'] = $category; + $pagevars['qpage'] = 0; + } } if ($pagevars['cat']){ $thispageurl->param('cat', $pagevars['cat']); -- 2.39.5