Modify

Opened 5 years ago

Closed 4 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: athomas
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 5 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 4 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.