This issue came up in the 4.6 beta (IIRC) and has reared its head again. When a user edits a previously submitted comment, comment.module will report out the user's name as "anonymous" to the rest of the system, but when the comment is viewed, the true author is still listed.

Comments

merlinofchaos’s picture

Assigned: Unassigned » merlinofchaos
Status: Active » Needs review
StatusFileSize
new5.43 KB

This one is because of work being done in _validate that is not valid. It is no longer allowed to change the form in _validate.

I moved all of the heavy lifting done in comment_validate to comment_form_submit, and I introduced a new $op for hook_comment: 'submit'.

I didn't find any instances of hook_comment being used anywhere in core, so I think we're ok there (but someone please doublecheck me and make sure I didn't screw up the grep).

dries’s picture

Status: Needs review » Needs work

Patch seems to break comment previews!

Cvbge’s picture

chx’s picture

StatusFileSize
new9.03 KB
merlinofchaos’s picture

Status: Needs work » Reviewed & tested by the community

+1 -- patch seems to work well for me in both admin and non-admin editing.

chx’s picture

Assigned: merlinofchaos » chx
Status: Reviewed & tested by the community » Needs work
Steve Dondley’s picture

When your preview the comment, and I stress *only when you preview*, the author is not anonymous. It is set to editor's name.

However, when the comment is actually displayed on the site, it says "Anonymous" as expected.

drumm’s picture

Status: Needs work » Needs review
StatusFileSize
new13.39 KB

I rerolled the patch to work for editing the information of anonymous commentors.

drumm’s picture

StatusFileSize
new12.63 KB

A little extra code got in this patch

grohk’s picture

+1 Works as advertised. Thanks for the patch.

dries’s picture

Status: Needs review » Fixed

Committed to HEAD. Thanks.

morbus iff’s picture

Status: Fixed » Needs work

This still appears to be broken somehow - in PHP 5, I can't submit a comment (either anonymous or admin) due to no valid date being passed. The trip through the rabbit hole starts in comment_validate which uses $date and not $edit['date']. We end up in a _submit call later on where a timestamp and a date are set, but that's too late, because comment_validate triggers before then (on a failed "is the date there?"). Haven't had much of a chance to look at it past there. It appears that we need to move the _submit timestamp/date stuff into comment_form.

morbus iff’s picture

Title: Comments module erasing author name after edit » Can't submit comments in PHP 5, anonymous or not
morbus iff’s picture

Status: Needs work » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)