MDL-68733 quiz editing: be more careful deleting random question tags

This commit is contained in:
Bence Molnar
2020-05-19 11:17:32 +01:00
committed by Tim Hunt
parent db233ce7e2
commit 3d9e7a3071
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ if ($mform->is_cancelled()) {
// Now, delete the remaining records.
if (!empty($recordstokeep)) {
list($select, $params) = $DB->get_in_or_equal($recordstokeep, SQL_PARAMS_QM, 'param', false);
$DB->delete_records_select('quiz_slot_tags', "id $select", $params);
$DB->delete_records_select('quiz_slot_tags', "slotid = {$slot->id} AND id $select", $params);
} else {
$DB->delete_records('quiz_slot_tags', array('slotid' => $slot->id));
}
+1 -1
View File
@@ -2546,7 +2546,7 @@ function quiz_retrieve_tags_for_slot_ids($slotids) {
}
}
$carry[$slottag->slotid][] = $slottag;
$carry[$slottag->slotid][$slottag->id] = $slottag;
return $carry;
},
$emptytagids