Modify

Opened 6 years ago

Closed 6 years ago

#3326 closed defect (fixed)

ERROR: field %r has too many values'

Reported by: didley@… Owned by: rharkins
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 6 years ago by anonymous

  • Cc rich@… added; anonymous removed
  • Owner changed from rharkins to anonymous
  • Status changed from new to assigned

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 6 years ago by rharkins

  • Owner changed from anonymous to rharkins
  • Status changed from assigned to new

comment:3 Changed 6 years ago by rharkins

  • Status changed from new to assigned

comment:4 Changed 6 years ago by rharkins

  • Priority changed from normal to high
  • Severity changed from normal to major

comment:5 Changed 6 years ago by didley@…

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

didley

comment:6 Changed 6 years ago by rharkins

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

Add Comment

Modify Ticket

Action
as closed The owner will remain rharkins.
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.