Skip to content

Commit

Permalink
MDL-63401 core: Do not delete the user context
Browse files Browse the repository at this point in the history
As long as we have a user record, we should not delete the context which
relates to it.
  • Loading branch information
andrewnicols committed Oct 8, 2018
1 parent cbae8dc commit 204abd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -4182,8 +4182,8 @@ function delete_user(stdClass $user) {
// Don't trigger update event, as user is being deleted.
user_update_user($updateuser, false, false);

// Now do a final accesslib cleanup - removes all role assignments in user context and context itself.
context_helper::delete_instance(CONTEXT_USER, $user->id);
// Delete all content associated with the user context, but not the context itself.
$usercontext->delete_content();

// Any plugin that needs to cleanup should register this event.
// Trigger event.
Expand Down

0 comments on commit 204abd3

Please sign in to comment.