When I edit a comment that's been marked as spam, none of the comment fields are filled in. Drupal treats the comment as if it doesn't exist. My best guess would be there's some check on the the status field in the comments table that's preventing it from working.
Comments
Comment #1
jeremy commentedI believe that this is a bug in Drupal, not the spam module. See this bug report which includes a patch to solve the problem.
I will leave this issue marked as "active" until the problem is solved in core so that other people who run into the same problem know how to fix it.
Comment #2
jeremy commentedActually, this turned out to be my misunderstanding when writing the spam module. I was setting a comment's status to 2 to unpublish it. However, there are only two recognized values: 1 (published) and 2 (unpublished / moderate). The fix is simple, updating the function spam_unpublish_comment to set the status to 1. The possible downside is that now all spam comments will end up in the comment moderation queue -- when getting slammed by hundreds of comments, this could be _very_ annoying.
It would be possible to make whether or not a spam comment shows up in the comment queue configurable, but this would require a patch to core. (Core doesn't display comments with a status of 2, and even if it did the status would be reset to 0 or 1 when the comment was saved via the edit form) A temporary workaround would be to set comments to a status of 3, instead of 2, allowing an admin to at least load them into the edit form. I don't like patching core, as it makes installation and maintenance of a module much more of a chore.
Thoughts?
Comment #3
jeremy commentedWhen unpublished, spam comments are now marked with status of 1. They also show up in the comment moderation queue. There's no way to really adjust this without a patch to core. As I don't user comment moderation myself, I probably won't look into this more unless there are requests (and helpful suggestions)
Anyway, unpublished spam comments are now visible in the edit form.
Comment #4
junyor commentedWhat kind of patch to core would be necessary to make this configurable? It's probably a nice enhancement to have different comment statuses working in core. That way, other modules can also add additional statuses without having to add core code.
Comment #5
jeremy commentedIt doesn't seem to be too difficult. Currently the status field is treated as a boolean, ie notice the two radio buttons at the bottom of the page when editing a comment: published / not published. This would have to be changes to support additional status settings. Perhaps to let other modules register additional values for the status? (But then who owns what status? ie, if spam uses 2, what prevents another module from also using 2 for their custom status)
It is a simple matter for the spam module to set the status to 2 (or any other number than the currently used 0 or 1), but as soon as you edit the comment the custom status will be lost.
Comment #6
(not verified) commented