Edgewall Software

Opened 12 years ago

Closed 11 years ago

#7704 closed defect (fixed)

Cannot update ticket_type with no name

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

Description (last modified by Remy Blank)

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
  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 (0)

Change History (3)

comment:1 by Remy Blank, 12 years ago

Description: modified (diff)
Milestone: 0.12
Owner: set to Remy Blank

I'll check if this still happens on trunk.

comment:2 by bladezibit@…, 12 years ago

Any news about this ?

comment:3 by Remy Blank, 11 years ago

Resolution: fixed
Status: newclosed

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=' ';

Modify Ticket

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