Edgewall Software
Modify

Opened 20 years ago

Closed 16 years ago

Last modified 16 years ago

#1449 closed defect (fixed)

Trac does not check for conflicts with custom fields, Action box disappears

Reported by: avalys@… Owned by: Remy Blank
Priority: normal Milestone: 0.11.3
Component: ticket system Version: 0.9
Severity: normal Keywords: custom fields
Cc: ashearerw@… Branch:
Release Notes:
API Changes:
Internal 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 (0)

Change History (11)

comment:1 by ashearerw@…, 19 years ago

Version: 0.8.10.9

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.

  1. Disallow all custom fields with the same names as built-in fields. If so, the TracTicketsCustomFields wiki page should be updated with that information and provide a list of the built-in fields to avoid. The Trac code could also be updated to check for conflicts and generate an error message.
  2. Instead, allow any custom field name, including 'status'. Since this almost worked in 0.8, it may be well be technically feasible. Trac would have to be changed to show the Action box even if there's a custom status field (matching 0.8's behavior), and to fix the "columns ticket, time field are not unique" message.

—Andrew Shearer

comment:2 by ashearerw@…, 19 years ago

Summary: Trac does not check for conflicts with custom fieldsTrac does not check for conflicts with custom fields, Action box disappears

comment:3 by anonymous, 19 years ago

Cc: ashearerw@… added

comment:4 by sid, 18 years ago

#2979 has been marked as a duplicate.

comment:5 by Christian Boos, 18 years ago

Keywords: custom fields added
Milestone: 0.12

I'd favor solution 1. from comment:1.

comment:6 by Christian Boos, 18 years ago

#5494 was closed as duplicate. There, the problem was for group. While this is not a name of a regular ticket field, there's nonetheless a conflict with the group selector using in the TracQuery language. The full list is:

  • report, order, desc, group, groupdesc, col, row, format

comment:7 by Christian Boos, 18 years ago

Milestone: 0.120.11
Owner: changed from Jonas Borgström to Christian Boos

comment:8 by osimons, 16 years ago

Owner: changed from Christian Boos 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 by Remy Blank, 16 years ago

Milestone: 0.11-retriage0.11.3
Owner: changed from osimons to Remy Blank

Do you mind if I grab this?

comment:10 by Remy Blank, 16 years ago

Resolution: fixed
Status: newclosed

Custom fields are ignored if they match a built-in field since [2885]. I have added a check against query arguments in [7769], using the list in comment:6 and additionally max and page.

comment:11 by Remy Blank, 16 years ago

…and verbose in [7770].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.