Steps to reproduce:
- Go to admin/user/permissions and check off "post comments" for anonymous users.
- Go to admin/content/type/story (for instance) and enable the option for Anonymous users to enter their contact info.
- Create a story.
- Log out.
- As an anonymous user, click "Add new comment."
- Change your username to something fun like "bananarama" and fill in some random junk in the comment box.
- Click "Preview"

Expected behaviour: the username on preview should be "bananarama"
Observed behaviour: the username is actually "Anonymous"

This is a regression from the way things worked in 5.x.

Comments

patchnewbie’s picture

Assigned: Unassigned » patchnewbie

This looks like a patch that would be a good starter for someone new to patching.

robloach’s picture

Status: Active » Needs review
StatusFileSize
new675 bytes

Here you go!

katbailey’s picture

Status: Needs review » Reviewed & tested by the community

I tested this patch and it works fine.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Instead of

+    elseif (!empty($comment->name)) {
+      $comment->registered_name = $comment->name;
+    }
     else {
       $comment->name = variable_get('anonymous', t('Anonymous'));
     }

What about

-    else
+    elseif (empty($comment->name)) {
       $comment->name = variable_get('anonymous', t('Anonymous'));
     }

So that the name is properly preserved if already set. I am not sure what is this mambo with registered_name.

robloach’s picture

Status: Needs work » Needs review
StatusFileSize
new682 bytes

Hmm, that seems to work quite nicely...

catch’s picture

Status: Needs review » Reviewed & tested by the community

Yep, very nice.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed then.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.