Skip to content
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 2144749 commit f4564374d71c1a65a49885ece8cbb25da1eaff2d @timhunt timhunt committed Dec 11, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/quiz/locallib.php
View
3 mod/quiz/locallib.php
@@ -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 f456437

Please sign in to comment.
Something went wrong with that request. Please try again.