Modify

Opened 15 years ago

Closed 14 years ago

#4710 closed defect (fixed)

Anonymous user's comments always show as "Commenty by anonymous..." even if name or email is supplied

Reported by: peter@… Owned by: Alec Thomas
Priority: normal Component: AddCommentMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When an anonymous users (such as accessing a public Trac install) adds a comment, the comment is entered like Comment by anonymous on Fri 27 Feb 2009 01:39:06 PM EST even thought the person entered their name or email address. Example URL here:

http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/wiki/MachII1.8SESImprovements#CommentbyanonymousonFri27Feb200901:39:06PMEST

Attachments (0)

Change History (2)

comment:1 Changed 15 years ago by bailey@…

The problem appears to be that some markup needed for Trac to find the value in the box was missing. The following patch fixes the problem for me (inlined since it's so short):

--- macro.py~   2009-03-30 16:49:32.000000000 -0400
+++ macro.py    2009-03-30 17:23:06.000000000 -0400
@@ -169,9 +169,11 @@
                         ),
                         (req.authname == 'anonymous' and tag.div(
                             tag.label("Your email or username:",
-                                    for_="authoraddcomment"),
-                            tag.input(id="authoraddcomment", type="text",
-                                    size=30, value=authname)
+                                      for_="authoraddcomment"),
+                            tag.input(name="authoraddcomment",
+                                      id="authoraddcomment", type="text",
+                                      size=30, value=authname),
+                            class_="field"
                         ) or None),
                         tag.input(type="hidden", name="__FORM_TOKEN",
                                         value=req.form_token),

comment:2 Changed 14 years ago by osimons

Resolution: fixed
Status: newclosed

(In [8746]) AddCommentMacro: New name for anonymous was not picked up. Fixes #4710. Thanks for the patch!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.