MDL-66796 question bank: 0 is a valid question category idnumber

This commit is contained in:
Tim Hunt 2019-09-30 13:13:06 +01:00
parent 8111abc331
commit 9c4f0fa746

View File

@ -469,9 +469,7 @@ class question_category_object {
$cat->infoformat = $newinfoformat;
$cat->sortorder = 999;
$cat->stamp = make_unique_id_code();
if ($idnumber) {
$cat->idnumber = $idnumber;
}
$cat->idnumber = $idnumber;
$categoryid = $DB->insert_record("question_categories", $cat);
// Log the creation of this category.
@ -552,9 +550,7 @@ class question_category_object {
$cat->infoformat = $newinfoformat;
$cat->parent = $parentid;
$cat->contextid = $tocontextid;
if ($idnumber) {
$cat->idnumber = $idnumber;
}
$cat->idnumber = $idnumber;
if ($newstamprequired) {
$cat->stamp = make_unique_id_code();
}