Edgewall Software
Modify

Opened 11 years ago

Last modified 9 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: Branch:
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@… 11 years ago.
Patch to implement custom field optional validation

Download all attachments as: .zip

Change History (7)

by trac@…, 11 years ago

Patch to implement custom field optional validation

comment:1 by Noah Kantrowitz, 11 years ago

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 by ebray, 11 years ago

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.

in reply to:  2 comment:3 by trac@…, 11 years ago

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 by Christian Boos, 11 years ago

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?

in reply to:  4 comment:5 by trac@…, 11 years ago

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 by Remy Blank, 9 years ago

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. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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