From 9d0ac0ffbb7d0696e59f7db3c60aa6945d2606cf Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 8 Dec 2011 19:06:02 +0000 Subject: [PATCH] MDL-27143 question bank: questions not saved when deleting a category. Based on a fix by Nikhil Gupta. --- lib/questionlib.php | 4 ++-- question/category_class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index 6e605dbcac5..2c77edada31 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -484,7 +484,7 @@ function question_delete_course_category($category, $newcategory, $feedback=true /** * Enter description here... * - * @param string $questionids list of questionids + * @param array $questionids of question ids * @param object $newcontext the context to create the saved category in. * @param string $oldplace a textual description of the think being deleted, * e.g. from get_context_name @@ -571,7 +571,7 @@ function question_delete_activity($cm, $feedback=true) { * function also have to do other work, which is why you should not call this method * directly from outside the questionbank. * - * @param string $questionids a comma-separated list of question ids. + * @param array $questionids of question ids. * @param integer $newcategoryid the id of the category to move to. */ function question_move_questions_to_category($questionids, $newcategoryid) { diff --git a/question/category_class.php b/question/category_class.php index 8881ce428a2..07c2d91be93 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -360,7 +360,7 @@ class question_category_object { global $DB; $questionids = $DB->get_records_select_menu('question', 'category = ? AND (parent = 0 OR parent = id)', array($oldcat), '', 'id,1'); - question_move_questions_to_category($questionids, $newcat); + question_move_questions_to_category(array_keys($questionids), $newcat); } /**