Ticket #1449 (closed defect: fixed)
Opened 7 years ago
Last modified 3 years ago
Trac does not check for conflicts with custom fields, Action box disappears
| Reported by: | avalys@… | Owned by: | rblank |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.3 |
| Component: | ticket system | Version: | 0.9 |
| Severity: | normal | Keywords: | custom fields |
| Cc: | ashearerw@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
If I create a custom ticket field by editing trac.ini, Trac does not check to see if the name of my custom field conflicts with the name of one of the stock fields.
For instance, if I create a field named 'status', anytime I make a change to the ticket that results in the stock 'status' field being changed, trying to submit the change results in an SQLite index violation error ("columns ticket, time field are not unique").
I don't know if it would be better to automatically check for these conflicts, or just named all custom fields custom_something.
Attachments
Change History
comment:1 Changed 6 years ago by ashearerw@…
- Version changed from 0.8.1 to 0.9
comment:2 Changed 6 years ago by ashearerw@…
- Summary changed from Trac does not check for conflicts with custom fields to Trac does not check for conflicts with custom fields, Action box disappears
comment:3 Changed 6 years ago by anonymous
- Cc ashearerw@… added
comment:4 Changed 5 years ago by sid
#2979 has been marked as a duplicate.
comment:5 Changed 5 years ago by cboos
- Keywords custom fields added
- Milestone set to 0.12
I'd favor solution 1. from comment:1.
comment:6 Changed 5 years ago by cboos
comment:7 Changed 5 years ago by cboos
- Milestone changed from 0.12 to 0.11
- Owner changed from jonas to cboos
comment:8 Changed 4 years ago by osimons
- Owner changed from cboos to osimons
I'm +1 on the first suggestion as well, and we should make a reserved_field_names list that we check; skip the field if name is reserved + log the error.
comment:9 Changed 3 years ago by rblank
- Milestone changed from 0.11-retriage to 0.11.3
- Owner changed from osimons to rblank
Do you mind if I grab this?
comment:10 Changed 3 years ago by rblank
- Resolution set to fixed
- Status changed from new to closed
comment:11 Changed 3 years ago by rblank
...and verbose in [7770].



The behavior in Trac 0.9 has changed. The entire Action box now disappears if there's a custom field named 'status', making it impossible to accept or close tickets. New or upgrading users can run into this, and the cause isn't obvious, especially since this worked for the most part under 0.8. (Specifically, everything worked under 0.8 unless the user both changed the custom status field and selected a ticket action in one form submission, which would result in the 'not unique' error message. Doing the same thing in two steps worked perfectly.)
At least one other person on the Trac mailing list apart from me encountered this when we upgraded to 0.9. Renaming the custom field (and running an UPDATE statement on the database to convert the old data) fixed it. The need for more status values is probably common, and naming a custom field 'status' isn't explicitly disallowed by the current documentation, so I'd expect others could run into this too.
I'd submit a patch to either the code or documentation, but I don't know which route the Trac developers would prefer.
--Andrew Shearer