Modify ↓
Opened 6 years ago
Closed 6 years ago
#13176 closed defect (fixed)
Skip custom field of type select with no options
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | low | Milestone: | 1.0.18 |
| Component: | ticket system | Version: | |
| Severity: | normal | Keywords: | ticket-custom |
| Cc: | Branch: | ||
| Release Notes: |
Select custom field is not created if it has no |
||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
Ticket custom field with no options is created as an empty select:
[ticket-custom] ... select1 = select ...
I found strange behavior resulted in ticket validation when testing #13040. A warning would be raised when cloning a ticket, but not when creating a new ticket.
I think it would be better to just skip creation of ticket custom field of type select when it has no options.
-
trac/ticket/api.py
diff --git a/trac/ticket/api.py b/trac/ticket/api.py index 9a752c32f..4c29f7c80 100644
a b class TicketSystem(Component): 379 379 } 380 380 if field['type'] == 'select' or field['type'] == 'radio': 381 381 field['options'] = config.getlist(name + '.options', sep='|') 382 if not field['options']: 383 continue 382 384 if '' in field['options']: 383 385 field['optional'] = True 384 386 field['options'].remove('')
The built-in ticket fields already have this behavior.
Attachments (1)
Change History (4)
by , 6 years ago
| Attachment: | Screen Shot 2019-07-03 at 12.32.01.jpg added |
|---|
comment:1 by , 6 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 6 years ago
Note:
See TracTickets
for help on using tickets.




Proposed changes in log:rjollos.git:t13176_select_without_options.