Skip to content

Commit

Permalink
MDL-62868 core_group: clear group_grouping cache when changing grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Jul 16, 2018
1 parent 8c51626 commit fd6d98c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions group/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@
// Invalidate the course groups cache seeing as we've changed it.
cache_helper::invalidate_by_definition('core', 'groupdata', array(), array($courseid));

// Invalidate the user_group_groupings cache, too.
cache_helper::purge_by_definition('core', 'user_group_groupings');
} else if (isset($frm->remove) and !empty($frm->removeselect)) {
foreach ($frm->removeselect as $groupid) {
// Ask this method not to purge the cache, we'll do it ourselves afterwards.
groups_unassign_grouping($grouping->id, (int)$groupid, false);
}
// Invalidate the course groups cache seeing as we've changed it.
cache_helper::invalidate_by_definition('core', 'groupdata', array(), array($courseid));

// Invalidate the user_group_groupings cache, too.
cache_helper::purge_by_definition('core', 'user_group_groupings');
}
}

Expand Down

0 comments on commit fd6d98c

Please sign in to comment.