]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14407
authortjhunt <tjhunt>
Thu, 17 Apr 2008 15:59:49 +0000 (15:59 +0000)
committertjhunt <tjhunt>
Thu, 17 Apr 2008 15:59:49 +0000 (15:59 +0000)
1. After deleting a question category, it redirects you back to a question bank URL. In some circumstances, this URL will contain a cat=nnn parameter of the category you have just deleted, which naturally leads to an error. This parameter needs to be removed.

2. When there are questions in the category that need to be moved, the category id we are moving to is not exploded on ','.

question/category.php

index 2fc0379b8af1495f1f6c30f2a268ebea0014057f..df3c5bb8911879df9d632aa9ecf274086288abfd 100644 (file)
@@ -57,7 +57,9 @@
             redirect($thispageurl->out());
         }  elseif ($formdata = $qcobject->moveform->get_data()) {
             /// 'confirm' is the category to move existing questions to
-            $qcobject->move_questions_and_delete_category($formdata->delete, $formdata->category);
+            list($tocategoryid, $tocontextid) = explode(',', $formdata->category);
+            $qcobject->move_questions_and_delete_category($formdata->delete, $tocategoryid);
+            $thispageurl->remove_params('cat');
             redirect($thispageurl->out());
         }
     } else {