Edgewall Software
Modify

Opened 19 years ago

Closed 17 years ago

Last modified 17 years ago

#2876 closed defect (fixed)

WebAdmin: severity order selection field is invalid

Reported by: Emmanuel Blot Owned by: osimons
Priority: low Milestone: 0.11
Component: admin/web Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In WebAdmin, when a severity item is deleted, the drop-down list of priority order is not reset.

For example:

  1. Initial severities { critical: 1, major: 2, normal: 3, minor: 4 }
  2. Action: delete severity "normal"
  3. Final severities { critical: 1, major: 2, minor: 4 }

→ order 3 is cannot be selected anymore.

Btw, I think a webadmin component should be added on p.e.c., as it is going to be part of the next Trac release.

Attachments (1)

t2876-r6286-enum_order-a.diff (1.4 KB ) - added by osimons 17 years ago.
Reorder + delete default setting from trac.ini if that option is deleted (strictly not needed). Added some tests.

Download all attachments as: .zip

Change History (10)

comment:1 by Matthew Good, 18 years ago

#3555 has been marked as a duplicate.

comment:2 by Matthew Good, 18 years ago

Component: trac-adminwebadmin
Keywords: webadmin removed
Milestone: 0.11
Owner: changed from daniel to Christopher Lenz

comment:3 by anonymous, 18 years ago

This also goes for Priority enum. I have changed these a couple of times (adding and deleting keywords and changing the order. I now have three Priority values: high, normal, wish. Their associated values are 7, 8, 9 which also breaks the coloring by priority report: all tickets are displayed in red.

comment:4 by anonymous, 18 years ago

Another problem I have is the top value in the list cannot be moved: when i now add a priority using trac_admin, and try to priority order <name> down/up, it won't move. Are these problems connected?

comment:5 by osimons, 17 years ago

Owner: changed from Christopher Lenz to osimons
Priority: lowestlow
Severity: trivialminor

A simple patch that sets new order (value field) to current-1 for all the values that are higher than the one being deleted:

  • trac/ticket/model.py

     
    371371        self.env.log.info('Deleting %s %s' % (self.type, self.name))
    372372        cursor.execute("DELETE FROM enum WHERE type=%s AND value=%s",
    373373                       (self.type, self._old_value))
     374        cursor.execute("UPDATE enum set value=value-1 where "
     375                       "type=%s and value>%s", (self.type, self._old_value))
    374376
    375377        if handle_ta:
    376378            db.commit()

By doing it in the model code, it works the same for both trac-admin and webadmin usage. I only have SQLite, but should be valid syntax on all backends, I guess?

in reply to:  4 comment:6 by osimons, 17 years ago

Replying to anonymous:

Another problem I have is the top value in the list cannot be moved: when i now add a priority using trac_admin, and try to priority order <name> down/up, it won't move. Are these problems connected?

This works fine for me - all works up and down as expected.

by osimons, 17 years ago

Reorder + delete default setting from trac.ini if that option is deleted (strictly not needed). Added some tests.

comment:7 by osimons, 17 years ago

Milestone: 0.11.10.11
Resolution: fixed
Status: newclosed

Implemented as [6317]. Ended up leaving the default setting in trac.ini as it does not interfere with anything.

Closes ticket.

comment:8 by osimons, 17 years ago

Actually, that was not the end of it… Follow-up in #6490, hopefully finally fixed in [6323].

comment:9 by osimons, 17 years ago

#4982 closed as duplicate.

Modify Ticket

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