From a75bcd9fafcc1c87694e2554ce06ebdc3b7e0909 Mon Sep 17 00:00:00 2001 From: Philipp Memmel Date: Mon, 18 Sep 2023 07:01:59 +0000 Subject: [PATCH] Fix core test core_calendar\container_test --- lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib.php b/lib.php index 71446a3d..53ee070d 100644 --- a/lib.php +++ b/lib.php @@ -174,13 +174,13 @@ function ratingallocate_delete_instance($id) { 'ratingallocateid' => $ratingallocate->id ), '', 'id')); - list ($insql, $params) = $DB->get_in_or_equal($deleteids); - - $DB->delete_records_select('ratingallocate_group_choices', + if (!empty($deleteids)) { + list ($insql, $params) = $DB->get_in_or_equal($deleteids); + $DB->delete_records_select('ratingallocate_group_choices', 'choiceid ' . $insql, $params); - - $DB->delete_records_select('ratingallocate_ch_gengroups', - 'choiceid ' . $insql, $params); + $DB->delete_records_select('ratingallocate_ch_gengroups', + 'choiceid ' . $insql, $params); + } $DB->delete_records('ratingallocate_groupings', array( 'ratingallocateid' => $ratingallocate->id