Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#263 closed defect (bug) (fixed)

Friend requests are still left after deletion of user.

Reported by: Jehy Owned by:
Milestone: Priority: critical
Severity: Version:
Component: Keywords:
Cc:

Description

I have deleted a user, but still see a buggy friend request - from someone nameless.
We need to clear it up, don't we?

Change History (5)

#1 @Jehy
13 years ago

  • Priority changed from minor to major

#2 @Jehy
13 years ago

  • Priority changed from major to critical

Also there is a bug entry left and being displayed to everybody if there are deleted users in friends.
There's an action , smth like "wp_on_delete_user", there we should remove these invalid links.

For now, you can use sql query

select wp_bp_friends.* from wp_bp_friends left join wp_users on (wp_users.ID=wp_bp_friends.friend_user_id or wp_users.ID=wp_bp_friends.initiator_user_id) WHERE ISNULL(wp_users.id)

and delete the results - it will remove invalid users from friends.

#3 @Jehy
13 years ago

UPD:

Sorry, a bit uncorrect. Here's the right query:

select wp_bp_friends.id from  wp_bp_friends left join wp_users on (wp_users.ID=wp_bp_friends.friend_user_id) WHERE ISNULL(wp_users.id) UNION select wp_bp_friends.id from  wp_bp_friends left join wp_users on (wp_users.ID=wp_bp_friends.initiator_user_id) WHERE ISNULL(wp_users.id)

#4 @apeatling
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

This is cleaned up with a wpmu_delete_user action call. The function delete_all_for_user() is called which will delete any requests and friendships for the user being deleted.

Notifications were not being deleted however - so I've modified the function to delete request notifications and new friendship notifications involving the deleted user for any member.

#5 @(none)
12 years ago

  • Milestone Friends 1.0 deleted

Milestone Friends 1.0 deleted

Note: See TracTickets for help on using tickets.