mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-32245 question bank: fix moving categories between contexts.
This commit is contained in:
parent
7d2c5cd0a0
commit
99231022af
1 changed files with 11 additions and 4 deletions
|
@ -61,11 +61,18 @@ $qcobject = new question_category_object($pagevars['cpage'], $thispageurl, $cont
|
|||
$streditingcategories = get_string('editcategories', 'question');
|
||||
if ($param->left || $param->right || $param->moveup || $param->movedown|| $param->moveupcontext || $param->movedowncontext){
|
||||
require_sesskey();
|
||||
|
||||
if ($param->moveupcontext || $param->movedowncontext) {
|
||||
$catid = ($param->moveupcontext > 0) ? $param->moveupcontext : $param->movedowncontext;
|
||||
$oldcat = $DB->get_record('question_categories', array('id' => $catid));
|
||||
$qcobject->update_category($catid, '0,'.$param->tocontext, $oldcat->name, $oldcat->info);
|
||||
} else {
|
||||
foreach ($qcobject->editlists as $list){
|
||||
//processing of these actions is handled in the method where appropriate and page redirects.
|
||||
$list->process_actions($param->left, $param->right, $param->moveup, $param->movedown,
|
||||
$param->moveupcontext, $param->movedowncontext, $param->tocontext);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($param->delete && ($questionstomove = $DB->count_records("question", array("category" => $param->delete)))){
|
||||
if (!$category = $DB->get_record("question_categories", array("id" => $param->delete))) { // security
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue