Edgewall Software
Modify

Opened 10 years ago

Last modified 8 years ago

#7911 new enhancement

Optional validation for custom fields

Reported by: trac@… Owned by:
Priority: normal Milestone: unscheduled
Component: ticket system Version: none
Severity: normal Keywords: ticket custom field validation consider
Cc:
Release Notes:
API Changes:

Description

JQuery permits a nice environment to build custom/dynamic drop-down lists for custom fields in trac tickets; unfortunately validation for the ticket fails as the dynamic value for a field with an option list cannot be found in the configuration file.

At least two solutions are possible:

  1. Add an option for turning off validation in comparing the value against the option list, and
  2. Allow for dynamic validation.

I have implemented the solution for #1 (attached).

Attachments (1)

custom-field-optional-validation.patch (1.7 KB ) - added by trac@… 10 years ago.
Patch to implement custom field optional validation

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by trac@…

Patch to implement custom field optional validation

comment:1 Changed 10 years ago by Noah Kantrowitz

Option 3, leave it as a text field in trac.ini and handle setting up the options in a pre-req filter. This seems too case-specific.

comment:2 Changed 10 years ago by ebray

If you're already depending on JavaScript to populate the options, why not leave it as a text field (so that people without JS can still use it) and use JS to convert it to a select and populate all the options from there.

comment:3 in reply to:  2 Changed 10 years ago by trac@…

I'm already conditionally swapping between a text field and a select. The reason I left it as a select is that Custom Query can utilize it (at least to group by) when it is a select.

Replying to ebray:

If you're already depending on JavaScript to populate the options, why not leave it as a text field (so that people without JS can still use it) and use JS to convert it to a select and populate all the options from there.

comment:4 Changed 10 years ago by Christian Boos

Keywords: consider added
Milestone: 0.13

So, IIUC, you're requesting a kind of "opened" list custom field type, with predefined values but not limiting ones, right?

comment:5 in reply to:  4 Changed 10 years ago by trac@…

That's another excellent interpretation. In my scenario, the predefined value list may be empty as it would change based on the content of other fields. There may be scenarios that have a few common list items.

Replying to cboos:

So, IIUC, you're requesting a kind of "opened" list custom field type, with predefined values but not limiting ones, right?

comment:6 Changed 8 years ago by Remy Blank

Milestone: next-major-0.1Xunscheduled

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.