Opened 11 years ago
Last modified 9 years ago
#10951 closed defect
[PATCH] Custom field order is not preserved — at Version 3
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | 0.11.6 |
Severity: | normal | Keywords: | custom field order needinfo |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It appears that _prepare_fields()
in ticket/web_ui.py
is supposed to order the fields for the ticket property box:
- Most standard fields
- Custom fields in the order specified by the user
- Keywords
However, what I see is like:
Reporter | Owner |
Priority | Milestone |
Custom 6 | Custom 7 |
Custom 8 | Custom 9 |
CC | Keywords |
Custom 0 | Custom 1 |
Custom 2 | Custom 3 |
Custom 4 | Custom 5 |
I've displayed the names, in order, from fields
in templates/ticket.html
and the fields are in the wrong order as the ticket is displayed.
This may be a complex interaction of many plugins. Or one plugin's ticket handling reordering fields. (I have ~30 plugins installed.) While there may be a bug in a plugin that should not reorder fields, Trac can enforce its intended order with the attached patch.
Change History (4)
by , 11 years ago
Attachment: | custom_order.patch added |
---|
comment:1 by , 11 years ago
By the way, the change I made to display field order in the ticket template is:
-
trac/ticket/templates/ticket.html
a b 159 159 <td headers="h_owner">${ticket.owner and authorinfo(ticket.owner) 160 160 </td> 161 161 </tr> 162 <span py:with="fieldorder=[f['name'] for f in fields]"> 163 ${pprint('fieldorder:%s' % fieldorder)} 164 </span> 162 165 <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea') 163 166 py:with="fullrow = len(row) == 1"> 164 167 <py:for each="idx, field in enumerate(row)">
I wish I could figure out how to write to trac.log
from a template but this is the best I could do.
comment:2 by , 11 years ago
Summary: | [PATHC] Custom field order is not preserved → [PATCH] Custom field order is not preserved |
---|
comment:3 by , 11 years ago
Description: | modified (diff) |
---|
Patch to enforce custom field order