MDL-74306 mod_assign: fix undefined property in override cache key.

This commit is contained in:
Paul Holden 2022-03-23 18:55:03 +00:00
parent 34ce1463cc
commit e420fbe303

View File

@ -10094,7 +10094,7 @@ function move_group_override($id, $move, $assignid) {
global $DB;
// Get the override object.
if (!$override = $DB->get_record('assign_overrides', ['id' => $id], 'id, sortorder, groupid')) {
if (!$override = $DB->get_record('assign_overrides', ['id' => $id, 'assignid' => $assignid], 'id, sortorder, groupid')) {
return false;
}
// Count the number of group overrides.
@ -10123,8 +10123,8 @@ function move_group_override($id, $move, $assignid) {
// Delete cache for the 2 records we updated above.
$cache = cache::make('mod_assign', 'overrides');
$cache->delete("{$override->assignid}_g_{$override->groupid}");
$cache->delete("{$swapoverride->assignid}_g_{$swapoverride->groupid}");
$cache->delete("{$assignid}_g_{$override->groupid}");
$cache->delete("{$assignid}_g_{$swapoverride->groupid}");
}
reorder_group_overrides($assignid);