Page MenuHomePhabricator

Deleting a comment doesn't delete the replies
Open, Needs TriagePublic

Description

Deleting a comment doesn't delete the replies.

Event Timeline

SamanthaNguyen subscribed.

Not specific to Brickimedia, removing the project tag

I am able to reproduce this bug. I would like to propose two solutions to this:

  1. If parent comment is deleted, then delete the entire thread. This doesn't sound right to me, because if there are 100 replies then the entire conversation is gone, which is not a good idea as there may be something useful in there for future reference.
  2. If parent comment is deleted, then display some text like "This comment was deleted by owner" and keep all the replies as it is. Moreover, an admin may have rights to delete the entire thread.
  1. If parent comment is deleted, then delete the entire thread. This doesn't sound right to me, because if there are 100 replies then the entire conversation is gone, which is not a good idea as there may be something useful in there for future reference.

I agree with you, this would be way too destructive.

  1. If parent comment is deleted, then display some text like "This comment was deleted by owner" and keep all the replies as it is. Moreover, an admin may have rights to delete the entire thread.

This would be the better solution, indeed. You'll likely need to query the core [[https://www.mediawiki.org/wiki/Manual:logging_table|logging table]] to get the name of the user who deleted a comment, though.

If you want a basic example of how the deleted comment should/could look like based on solution 2, I made one a while ago (for another ticket, at T127595#2589627), here's the codepen: http://s.codepen.io/SamanthaNguyen/debug/WxVyQm/NQAzYvQbJWmr

If that debug session is outdated by the time you see it, you can look at the screenshot from the link I posted :)

This would be the better solution, indeed. You'll likely need to query the core [[https://www.mediawiki.org/wiki/Manual:logging_table|logging table]] to get the name of the user who deleted a comment, though.

I was thinking of just clearing comment text without printing the user's (owner) name similar to the sample provided by @SamanthaNguyen. Is it a good idea?

Having it always say "this comment was deleted by the owner" isn't accurate, because sometimes (and probably more than likely), a comment administrator might delete the comment instead. You should write a query that will get the name of user who deleted it (although sometimes that might want to be hidden as well; I wrote a task that's basically a response to this which is T155602. I'm guessing this should probably done first and have the text for a deleted comment be simple at first, but I believe it can be enhanced and improved even more. :)

Change 332723 had a related patch set uploaded (by Mihir-thakkar):
Fix for delete comment bug

https://gerrit.wikimedia.org/r/332723

Aklapper added subscribers: Mihir-thakkar, Aklapper.

Removing task assignee due to inactivity, as this open task has been assigned to the same person for more than two years (see the emails sent to the task assignee on Oct27 and Nov23). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.
(See https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator.)