1) User X (with a defined role) posts a comment to a content type like forum or blog.
2) An 'edit' link is now visible to user X for that comment.
3) User Y (regardless of its role) posts a new comment in reply to user X's comment.
4) The 'edit' link is no longer visible to user X.
5) If user Y's comment is deleted, user X can once again see the 'edit' link.
The expected behavior is for the comment to be editable by its owner independently of any threading to that comment.
Instead, the comment is editable by its owner only if no one replied to it.
Note:
- This behavior is consistent, across user roles, content types, and custom/garland themes.
- For an 'admin' user role (the only one with 'administer comments' permission) the 'edit' link does appear as expected.
Comments
Comment #1
SpikeX commentedSubscribed. I think this is stupid behavior that needs to be fixed, or at least optionalized.
Comment #2
SpikeX commentedIf you want this behavior off, for now, you can hack your core file to remove it. I don't recommend this, but if you're desperate:
Find this code in /modules/comment/comment.module
And replace it with this:
Comment #3
dsanchez commentedI think an user should be able to edit his comment at any time. A message, however, could be shown at the bottom of the comment, something like "Comment edited by xxxx on the date"
Comment #5
jose reyero commentedI think this (the current one) is just the expected behavior for comments and if comments could be edited after a reply most of us would need an option to disable that.
Thus, this is not a bug, but a design decision and changing that would make a feature request for either Drupal 7 or Drupal 8.
See #10700: Ability to delete own comments before reply is added
Comment #7
j.c.gram commentedFor anyone looking to do this without hacking core:
Comment #8
sgtsaughter commentedTested #7 and it works when I put it in my custom module. You just have to put an open quote in the last line
mymodule_comment_edit';
change to
'mymodule_comment_edit';