Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Apr 2015 at 00:39 UTC
Updated:
27 Jan 2017 at 17:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drummComment #2
drummComment #3
jibranif it affects drupal.org then it will be back ported.
Comment #4
jcnventura@drumm I can confirm that the patch fullfils its objective. But this needs a test.
Comment #5
drummYep. I couldn't actually find any existing tests that looked good to extend for this. Any advice for where the test could live?
Comment #6
jcnventura@drumm Funny I was going to ask you the same question :)
Comment #7
jcnventura@drumm: I'm creating a new test class called CommentUserChangesTest
Comment #8
jcnventuraI ended up adapting the existing UserCancelTest test
Here's the patch with tests.
Comment #9
jcnventuraI keep forgetting the status..
And the funny thing is that in the tests $test_node->getRevisionAuthor()->getUsername() is 'admin' after the anonymization takes place, but that seems to be a side effect of the fact that the author is uid 0.
Comment #10
jibranAwesome this looks good let's wait for bot.
Comment #12
jibranlet's fix d.o
Comment #13
drummThanks for the tests, looks great.
Here's the D7 version, without tests yet.
Comment #14
drummComment #15
xjmThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed and pushed to 8.0.x. Moving to 7.x for backport.
Comment #17
jcnventuraAnd a fixed D7 patch with tests...
Comment #18
drummLooks good.
Comment #21
dcam commentedI tested it too. RTBC+1 from me. Resetting the status.
Comment #24
dcam commentedComment #25
drummThis is now deployed on Drupal.org.
Comment #26
David_Rothstein commentedHm, are we sure the current behavior isn't intentional? Consider two identical sites (and assume anonymous users are allowed to leave comments):
So comparing the two sites you can't actually tell that the real President Obama was ever a member of the first one anyway. (The appearance of the "not verified" is supposed to indicate that this the comment wasn't left by a registered user, so it doesn't actually provide any identifying info - anyone could have typed that name in.)
To be more specific, the reason you might want to leave the names behind when deleting the account is to distinguish the comments on a long thread, e.g. if multiple users who commented on that thread had their accounts deleted, for sanity's sake you still want to see that the comments were left by different people.
I can see why drupal.org (which doesn't allow anonymous commenting in the first place) might rather delete these but I'm not sure it's the right solution in general. This could use some more discussion.
Comment #27
drummThe cancel user UI says "Delete the account and make its content belong to the Anonymous user." That makes me think the usernames should not remain. There isn't equivalent keeping names like this for nodes.
If a site wants to keep names on content, blocking the account might be the way to go.
This came up for Drupal.org when someone who had cancelled their account contacted us asking why their name was still appearing.
Comment #28
jcnventuraI agree with @drumm. It is confusing to the extreme that "make its content belong to the Anonymous user", doesn't apply to all content. This should be consistent across the board.
Comment #29
David_Rothstein commented"Content" is an ambiguous word - I think both interpretations are valid here, and certainly both use cases are valid.
We are talking about deleting data from the database, so I really don't think this behavior is something we can just change out from under people in the middle of a stable release. I hate to suggest adding more options to the admin UI, but since both scenarios are valid, that could be an option here - the Comment module could add a checkbox that allows the administrator to choose between the two behaviors.
Comment #30
jcnventuraAgree this is not a D7 bug, but rather something slightly different from current D7 functionality.
But don't put this option in the comment module settings. This should be a form:_alter, adding that option to the user delete UI.
Comment #31
jcnventura