Opened 20 years ago
Closed 20 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: |
Description
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)
Change History (3)
by , 20 years ago
Attachment: | Ticket.py.patch added |
---|
comment:1 by , 20 years ago
comment:2 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied in [1638], ported to 0.8-stable in [1639]. Thanks!
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 …
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.