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

sirkitree’s picture

Status: Active » Needs review

THere is currently a hook_user_cancel() implementation, however it looks like it's being used incorrectly. The API docs state:

... Depending on the account cancellation method, the module should either do nothing, unpublish content, or anonymize content. See user_cancel_methods() for the list of default account cancellation methods provided by User module. ...

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()?

drewish’s picture

I 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.