MDL-61556 Questions: Fixed moving question categories between contexts
This commit is contained in:
@@ -76,8 +76,12 @@ if ($param->moveupcontext || $param->movedowncontext) {
|
||||
} else {
|
||||
$catid = $param->movedowncontext;
|
||||
}
|
||||
$newtopcat = question_get_top_category($param->tocontext);
|
||||
if (!$newtopcat) {
|
||||
print_error('invalidcontext');
|
||||
}
|
||||
$oldcat = $DB->get_record('question_categories', array('id' => $catid), '*', MUST_EXIST);
|
||||
$qcobject->update_category($catid, '0,'.$param->tocontext, $oldcat->name, $oldcat->info);
|
||||
$qcobject->update_category($catid, "{$newtopcat->id},{$param->tocontext}", $oldcat->name, $oldcat->info);
|
||||
// The previous line does a redirect().
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user