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

This commit is contained in:
Bence Molnar 2020-05-18 21:04:36 +01:00 committed by Tim Hunt
parent c689726d3f
commit 9024289626
2 changed files with 2 additions and 2 deletions

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));
}

View File

@ -2580,7 +2580,7 @@ function quiz_retrieve_tags_for_slot_ids($slotids) {
}
}
$carry[$slottag->slotid][] = $slottag;
$carry[$slottag->slotid][$slottag->id] = $slottag;
return $carry;
},
$emptytagids