Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

#11960 closed defect (fixed)

Ticket clone warns: The action "None" is not available.

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.4
Component: ticket system Version: 1.1dev
Severity: normal Keywords: ticketclone
Cc: Branch:
Release Notes:

Fixed warning The action "None" is not available when cloning a ticket.

API Changes:

Description

Enabling TicketClone adds the +# Clone button to pre-fill the new ticket form. Now clicking the button shows a warning "The action "None" is not available".

The warning seems to have been added in [13452] for #2045.

Attachments (2)

NewTicketPage.png (27.0 KB ) - added by Ryan J Ollos 5 years ago.
t11960.diff (889 bytes ) - added by Ryan J Ollos 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Ryan J Ollos, 5 years ago

Milestone: 1.1.4
Owner: set to Ryan J Ollos
Status: newassigned

by Ryan J Ollos, 5 years ago

Attachment: NewTicketPage.png added

comment:2 by Ryan J Ollos, 5 years ago

comment:3 by Ryan J Ollos, 5 years ago

Issue can also be reproduced by navigating directly to /newticket?summary=thesummary&preview= (omitting summary results in a traceback).

Proposed change is to select the first action as the default action, rather than using None as the default action:

  • trac/ticket/web_ui.py

    diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py
    index 9335244..b482ab3 100644
    a b class TicketModule(Component):  
    488488
    489489        preview = 'preview' in req.args
    490490        if preview or req.method == 'POST':
    491             action = req.args.get('action')
     491            actions = TicketSystem(self.env) \
     492                      .get_available_actions(req, ticket)
     493            default_action = actions[0] if len(actions) > 0 else None
     494            action = req.args.get('action', default_action)
    492495            valid = True
    493496            # Do any action on the ticket?
    494             actions = \
    495                 TicketSystem(self.env).get_available_actions(req, ticket)
    496497            if action not in actions:
    497498                valid = False
    498499                add_warning(req, _('The action "%(name)s" is not available.',

by Ryan J Ollos, 5 years ago

Attachment: t11960.diff added

comment:4 by Ryan J Ollos, 5 years ago

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

Fixed in [13768].

Modify Ticket

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