MDL-81254 grade: ensure we always close the graded user iterator.
This ensures that the recordsets contained within are also closed when we're done with them.
This commit is contained in:
@@ -238,6 +238,7 @@ if (($itemtype !== 'select') && ($itemtype !== 'grade_select') &&($itemtype !==
|
||||
$stickyfooter = new core\output\sticky_footer($footercontent);
|
||||
$stickyfooter = $OUTPUT->render($stickyfooter);
|
||||
|
||||
$gui->close();
|
||||
}
|
||||
|
||||
echo $OUTPUT->render_from_template('gradereport_singleview/report', [
|
||||
|
||||
@@ -170,7 +170,6 @@ if (has_capability('moodle/grade:viewall', $context)) {
|
||||
echo $report->print_table(true);
|
||||
}
|
||||
}
|
||||
$gui->close();
|
||||
} else { // Show one user's report.
|
||||
// Store the id of the current user item in a session variable which represents the last viewed item.
|
||||
$SESSION->gradereport_user["useritem-{$context->id}"] = $userid;
|
||||
@@ -192,6 +191,8 @@ if (has_capability('moodle/grade:viewall', $context)) {
|
||||
$stickyfooter = new core\output\sticky_footer($userreportrenderer->user_navigation($gui, $userid, $courseid));
|
||||
echo $OUTPUT->render($stickyfooter);
|
||||
}
|
||||
|
||||
$gui->close();
|
||||
} else {
|
||||
// Students will see just their own report.
|
||||
// Create a report instance.
|
||||
|
||||
@@ -131,7 +131,6 @@ class gradereport_user_renderer extends plugin_renderer_base {
|
||||
while ($userdata = $gui->next_user()) {
|
||||
$users[$userdata->user->id] = $userdata->user;
|
||||
}
|
||||
$gui->close();
|
||||
|
||||
$arraykeys = array_keys($users);
|
||||
$keynumber = array_search($userid, $arraykeys);
|
||||
|
||||
Reference in New Issue
Block a user