Permalink
Browse files

MDL-37098 quiz: event handler fails deleting group with no overrides

This was a regression from MDL-35717.
  • Loading branch information...
1 parent cf617e1 commit 71cc181bac6d964c536d1e6ebfcfa9134d3b9151 @timhunt timhunt committed with danpoltawski Dec 11, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/quiz/locallib.php
View
@@ -1624,6 +1624,9 @@ function quiz_groups_group_deleted_handler($event) {
WHERE quiz.course = :courseid AND grp.id IS NULL";
$params = array('courseid'=>$event->courseid);
$records = $DB->get_records_sql_menu($sql, $params);
+ if (!$records) {
+ return; // Nothing to do.
+ }
$DB->delete_records_list('quiz_overrides', 'id', array_keys($records));
quiz_update_open_attempts(array('quizid'=>array_unique(array_values($records))));
}

0 comments on commit 71cc181

Please sign in to comment.