MDL-67494 calendar: user_delete_user should delete all user events

This commit is contained in:
Simey Lameze
2021-03-03 16:29:20 +08:00
parent 0375020308
commit fe0a2248f1
+1 -1
View File
@@ -4275,7 +4275,7 @@ function delete_user(stdClass $user) {
// Now do a brute force cleanup.
// Delete all user events and subscription events.
$DB->delete_records_select('event', 'userid = :userid AND subscriptionid IS NOT NULL', ['userid' => $user->id]);
$DB->delete_records_select('event', 'userid = :userid', ['userid' => $user->id]);
// Now, delete all calendar subscription from the user.
$DB->delete_records('event_subscriptions', ['userid' => $user->id]);