Skip to main content
edited tags
Link
Slate StaffMod
  • 10.5k
  • 5
  • 40
  • 61
edited tags
Link
Slate StaffMod
  • 10.5k
  • 5
  • 40
  • 61
Source Link
Ryan M
  • 28.7k
  • 10
  • 78
  • 131

Moderators trying to delete or undelete comments are now prompted to confirm (and canceling does not work)

As a moderator on a site that I moderate, upon clicking the "delete" link on a comment, I am shown a "Really delete this comment?" browser confirmation prompt; regardless of how I respond, the comment is deleted. The same occurs for undeletion: a "Really undelete this comment?" prompt, and the comment is undeleted regardless of the response.

The correct behavior is that moderators should not be prompted to confirm comment deletions or undeletions. This is how it worked before, which is important when we need to delete a large number of comments from a thread (fairly common). Incorrect or accidental deletions can be trivially reversed with a single additional click, so no confirmation is required.


Technical details:

This bug has very similar behavior to (and likely the same root cause as) When a moderator upvotes a comment on a site they moderate, the error message "You cannot mark a comment more than once" shows up, in that both appear to be related to the action being attempted twice. I'm reporting it separately to ensure that both get fixed, and to ensure that the correct behavior (no prompt) is documented.

If I click OK on the delete prompt, two https://stackoverflow.com/posts/comments/$COMMENT_ID/vote/10 POST requests are made, and the comment is deleted. If I click cancel, one request is made, and the comment is still deleted. The same occurs for undeletion, with two requests to https://stackoverflow.com/admin/posts/$POST_ID/comments/$COMMENT_ID/undelete on OK, and one request on cancel (with the comment being undeleted in either case).