Modify

Opened 9 years ago

Closed 9 years ago

#3326 closed defect (fixed)

ERROR: field %r has too many values'

Reported by: didley@… Owned by: Rich Harkins
Priority: high Component: TracFormsPlugin
Severity: major Keywords:
Cc: rich@… Trac Release: 0.11

Description

I did use this small form

#
#
#
#! subcontext systems
#! submit_label "Update systems"
#! track_fields

||'''No'''||'''what'''||'''description'''||'''comment'''||'''Who'''||'''When'''||||
||1||naming computer||sticker for the device and a name for the domain||[tf.textarea:name "hans"]||[tf.who:name]||[tf.when:name]||[tf:name]||

after a update not always round about all second update I get this error

Traceback (most recent call last):
  File "build\bdist.win32\egg\tracforms\macros.py", line 354, in process
    return str(fn(*args, **kw))
  File "build\bdist.win32\egg\tracforms\macros.py", line 425, in op_textarea
    current = self.get_field(field)
  File "build\bdist.win32\egg\tracforms\macros.py", line 372, in get_field
    return 'ERROR: field %r has too many values' % str(field)
NameError: global name 'field' is not defined

The log file has no entry.

Attachments (0)

Change History (6)

comment:1 Changed 9 years ago by anonymous

Cc: rich@… added; anonymous removed
Owner: changed from Rich Harkins to anonymous
Status: newassigned

The good news: I just committed r3946, which has a fix for this in the branches/release-0.2 area. I'll merge this change up into trunk next week, but you can get it now if you like.

The bad news: That is happening because there are two fields with the same effective name (which is coincidentally named "name" in the example) which is going to cause a different, albeit proper, error once you update.

The form would need to change a little -- [tf.textarea:name "hans"] needs to differ from [tf:name] (a checkbox) since they are different fields. Perhaps [tf.textarea:name_string "hans"] might work. The thing is that there are two different fields being stored here -- one is a textarea and the other a checkbox.

The tricky question is whether the form intends to see the [tf.who:name] from the checkbox or the textarea...

comment:2 Changed 9 years ago by Rich Harkins

Owner: changed from anonymous to Rich Harkins
Status: assignednew

comment:3 Changed 9 years ago by Rich Harkins

Status: newassigned

comment:4 Changed 9 years ago by Rich Harkins

Priority: normalhigh
Severity: normalmajor

comment:5 Changed 9 years ago by didley@…

Ok. I changed to r3946 and I will use to different names for textarea and input.

didley

comment:6 Changed 9 years ago by Rich Harkins

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rich Harkins.
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.