From 1fe2c24de394472fa9b3752c7c263eb55cfb9e23 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Tue, 5 Feb 2008 12:08:38 +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. --- question/editlib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/question/editlib.php b/question/editlib.php index 1ce4e085507..2f5c45c1539 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']);