Modify

Opened 9 years ago

#12426 new defect

'fields_map' also needs to be regenerated along with 'fields' in post_process_request in web_ui.py

Reported by: gpoveda@… Owned by: bphinz
Priority: high Component: TicketFieldsPlugin
Severity: critical Keywords:
Cc: gpoveda@… Trac Release: 1.0

Description

The TicketFields class in web_ui.py modifies what fields exist for the current ticket. Line 112 specifically updates the 'fields':

data['fields'] = [f for f in data['fields'] if f['name'] in displayed_fields]

Whenever a request processed in this way that changes what ticket fields exist, Trac's 'fields_map' also needs to be regenerated, eg, line 113 should look like:

data['fields_map'] = dict((field['name'], i)
                       for i, field in enumerate(data['fields']))

Not updating the 'fields_map' leads to errors when generating resources that index into the map. Specifically in my situation, it caused the resolution report link at the top of a ticket, eg. (fixed), to be replaced with a report link using my cc field contents, eg. (cm).

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain bphinz.

Add Comment


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

 
Note: See TracTickets for help on using tickets.