Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

#12400 closed defect (fixed)

Custom field "milestone" is not appeared with the field is defined and defined milestones are removed

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.11
Component: ticket system Version: 1.0.10
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix missing milestone field in ticket form when the field is custom field and no defined milestones.

API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Custom field is allow to use the same name of ticket field when no defined enums/components/milestones/versions. Actually, priority, version, component, resolution, severity and type fields is appeared in ticket box and form.

However, milestone field is not appeared in ticket form. The milestone is appeared in ticket view.

[ticket-custom]
priority = text
priority.format = plain
priority.label = (priority)
priority.options =
priority.order = 1
priority.value =
milestone = text
milestone.format = plain
milestone.label = (milestone)
milestone.options =
milestone.order = 2
milestone.value =
version = text
version.format = plain
version.label = (version)
version.options =
version.order = 3
version.value =
component = text
component.format = plain
component.label = (component)
component.options =
component.order = 4
component.value =
resolution = text
resolution.format = plain
resolution.label = (resolution)
resolution.options =
resolution.order = 5
resolution.value =
severity = text
severity.format = plain
severity.label = (severity)
severity.options =
severity.order = 6
severity.value =
type = text
type.format = plain
type.label = (type)
type.options =
type.order = 7
type.value =

Attachments (2)

ticket-box.png (10.3 KB ) - added by Jun Omae 8 years ago.
ticket-form.png (15.0 KB ) - added by Jun Omae 8 years ago.

Download all attachments as: .zip

Change History (8)

by Jun Omae, 8 years ago

Attachment: ticket-box.png added

by Jun Omae, 8 years ago

Attachment: ticket-form.png added

comment:1 by Jun Omae, 8 years ago

Description: modified (diff)

comment:2 by Jun Omae, 8 years ago

Description: modified (diff)

comment:3 by Jun Omae, 8 years ago

Query system crashes in this case.

2016-03-14 14:37:17,211 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/query'">, referrer None
Traceback (most recent call last):
  File "/home/jun66j5/src/tracdev/git/trac/web/main.py", line 554, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/jun66j5/src/tracdev/git/trac/web/main.py", line 247, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/jun66j5/src/tracdev/git/trac/ticket/query.py", line 1004, in process_request
    return self.display_html(req, query)
  File "/home/jun66j5/src/tracdev/git/trac/ticket/query.py", line 1121, in display_html
    data = query.template_data(context, tickets, orig_list, orig_time, req)
  File "/home/jun66j5/src/tracdev/git/trac/ticket/query.py", line 768, in template_data
    for opt in field['options']]
KeyError: 'options'

comment:4 by Jun Omae, 8 years ago

Milestone: next-stable-1.0.x1.0.11
Owner: set to Jun Omae
Status: newassigned

The following would fix missing milestone as custom field in ticket form. That issue in comment:3 would be fixed in #12399.

  • trac/ticket/web_ui.py

    diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py
    index 5c267d9e3..f047a228b 100644
    a b class TicketModule(Component):  
    14961496                    if 'TICKET_MODIFY' in req.perm(ticket.resource):
    14971497                        field['skip'] = False
    14981498                        owner_field = field
    1499             elif name == 'milestone':
     1499            elif name == 'milestone' and not field.get('custom'):
    15001500                milestones = [Milestone(self.env, opt)
    15011501                              for opt in field['options']]
    15021502                milestones = [m for m in milestones
Version 0, edited 8 years ago by Jun Omae (next)

comment:5 by Jun Omae, 8 years ago

Proposed changes in log:jomae.git@t12400, added unit tests for other fields.

comment:6 by Jun Omae, 8 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Comiitted in [14633] and merged to trunk in [14634].

Modify Ticket

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