Closed (duplicate)
Project:
Drupal core
Component:
comment.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
16 Feb 2005 at 17:43 UTC
Updated:
21 Jan 2006 at 06:47 UTC
Jump to comment: Most recent file
Hi,
I'm an administrator, and I've discovered that when I delete a user, drupal deletes a) all the forums that the user has created and b) if the user has made any comments in someone else's forum, that forum gets deleted too.
i.e. if Dan has commented in the Italian Food forum (the forum was created by admin), and I delete Dan's account, the Italian Food forum disappears entirely from the "Forums" page.
Any help for this?
Many thanks! (I love drupal)
Jill
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | comment_author_delete.patch | 996 bytes | menesis |
Comments
Comment #1
menesis commentedI've run into such problem before, with nodes authored by deleted user which dissapear, see http://drupal.org/node/19055 . I've fixed that for myself by resetting node's author to Anonymous, so that the node remains visible. Neither nodes nor comments aren't deleted, they are still there in database, but queries break and nodes or whole forums are not shown.
Same fix could be done to comments. Since comments have author's name as well as uid, changing their uid to 0 still leaves the comment with poster's name, so they look the same, and forums or any other nodes the user commented on don't disappear.
This fixes a problem with broken forums, but others don't like such approach because if they delete the user, that's because he abused or spammed the site, so they want to delete his/her nodes/comments as well. You could do that same way as in my patches, changing queries from UPDATE to DELETE.
Comment #2
Uwe Hermann commentedUpdating status.
Comment #3
drummI've apparently been using this patch on my checkout for awhile now. I haven't noticed any problems.
Comment #4
dries commentedThis is probably due to a misplaced INNER JOIN, that should be LEFT JOIN.
There are 11 core tables whose rows would need to get fixed, and many more in the contributions repository:
Fixing the offending SQL queries might be the /better/ fix?
Comment #5
dries commentedComment #6
dopry commentedthere is another issue dealing with handling user deletion that allows this to be configurable.
see node/8.