Edgewall Software

Opened 17 years ago

Closed 17 years ago

#1525 closed defect (fixed)

Select custom fields are not properly displayed

Reported by: tpease::at::ball::dot::com Owned by: Jonas Borgström
Priority: normal Milestone: 0.8.2
Component: ticket system Version: 0.8.1
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


When a ticket contains custom fields of the type select, the original values for the select fields are not carried over when the ticket is modified.

In the Change Properties section of a ticket view, all select fields revert to the first item in the list of values regardless if a default value is specified in the trac.ini file and regardless of the previos value of the select field. The ticket summary at the top of the page (in the yellow box), however, does display the correct values for the select fields.

Whenever a ticket is modified or commented upon, all select fields will be changed when a user hits the Submit Changes button. The only work-around is to manually update the affected fields with the values found in the summary section at the top of the page. Mildly annoying.

This same issue is mentioned at the end of Ticket #1431.

Attachments (1)

Ticket.py.patch (397 bytes ) - added by tpease::at::ball::dot::com 17 years ago.

Download all attachments as: .zip

Change History (3)

by tpease::at::ball::dot::com, 17 years ago

Attachment: Ticket.py.patch added

comment:1 by tpease::at::ball::dot::com, 17 years ago

The error arises from a conflict between the trac.ini file and tickets imported from other databases — Bugzilla in our case.

We created some custom ticket fields to handle extra information that Bugzilla contains and that Trac does not. Our Trac ini file looked something like this …

custom_four = select
custom_four.label = Defect Category
custom_four.options = Action Item | Any | Capability | Maintenance | Documentation | Usability | Performance
custom_four.value = 0
custom_four.order = 3

The space characters between the '|' separator was cuasing the problem. Trac was looking for a value of " Any " in the ticket database, but since we imported from Bugzilla, it was only finding "Any". Hence, the select field never found a valid match.

The work-around is to remove the space characters surrounding the '|' separator in the trac.ini file. However, a better solution is to patch the "get_custom_fields" method of the "Ticket.py" file. The attached patch file fixes "Ticket.py" such that spaces are stripped from the option values.

comment:2 by Christopher Lenz, 17 years ago

Resolution: fixed
Status: newclosed

Patch applied in [1638], ported to 0.8-stable in [1639]. Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.