Edgewall Software
Modify

Ticket #7704 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Cannot update ticket_type with no name

Reported by: bladezibit@… Owned by: rblank
Priority: normal Milestone: 0.12
Component: ticket system Version: 0.10.5
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description (last modified by rblank) (diff)

Trac allow addition of Ticket Type named " " (without quote).

When I try to remove a Ticket Type named " " (by clicking the remove button), the system fails silently and nothing happend (the category is still there).

When I try to set the Ticket Type named " " as default, the system fails silently (the old default Ticket Type is still the default).

If I try to change the Order of my Ticket Type, I get the following exception:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/opt/trac/plugins/TracWebAdmin-0.1.2dev_r4240-py2.4.egg/webadmin/web_ui.py", line 109, in process_request
  File "/opt/trac/plugins/TracWebAdmin-0.1.2dev_r4240-py2.4.egg/webadmin/ticket.py", line 367, in process_admin_request
  File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 388, in update
    assert self.name, 'Cannot update %s with no name' % self.type
AssertionError: Cannot update ticket_type with no name

Trac should not allow addition of Ticket Type named " " if it's not a valid name...

Thx,
Fred

Attachments

Change History

comment:1 Changed 3 years ago by rblank

  • Description modified (diff)
  • Milestone set to 0.12
  • Owner set to rblank

I'll check if this still happens on trunk.

comment:2 Changed 3 years ago by bladezibit@…

Any news about this ?

comment:3 Changed 3 years ago by rblank

  • Resolution set to fixed
  • Status changed from new to closed

On trunk it is already not possible to add a ticket type (or any other select field) with only whitespace in the name, neither with trac-admin nor in the admin panels.

I have fixed a few inconsistencies in whitespace normalization in [8399], changed the AssertionError when adding or renaming a field value to whitespace-only into a slightly more user-friendly TracError, and fixed the admin panels to display e.g. "Invalid component name" instead of "Component already exists" if the name field is empty (and the same in the roadmap).

If you had already added a whitespace-only value in the past, you will have to remove it with some SQL-fu, e.g.:

DELETE FROM enum WHERE type='ticket_type' AND name=' ';
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from rblank. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.