Needs review
Project:
Flag Friend
Version:
7.x-1.0-alpha7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2011 at 18:49 UTC
Updated:
29 Aug 2012 at 20:02 UTC
it's probably an exception that doesn't happen often but I thought I document it:
When you delete a user the friend counts will be incorrect since deleting the user doesn't remove them from the flag_friends table and the flag_friend_get_friend_count query doesn't check if a user is still there.
Doing a check in that function would probably have some performance implications. Maybe add a hook_user_delete to remove the friends before a user gets deleted?
Comments
Comment #1
sirkitree commentedTHere is currently a
hook_user_cancel()implementation, however it looks like it's being used incorrectly. The API docs state:So it would seem that we need to do a little detection of the method of cancelation in here?
Maybe we just need to use
hook_user_delete()?Comment #2
drewish commentedI think we should definitely be implementing hook_user_delete() for the cases when the user is deleted. Probably worth figuring out what canceling means separately.