Edgewall Software

Ticket #2876 (closed defect: fixed)

Opened 3 years ago

Last modified 19 months ago

WebAdmin: severity order selection field is invalid

Reported by: eblot Owned by: osimons
Priority: low Milestone: 0.11
Component: admin/web Version: devel
Severity: minor Keywords:
Cc:

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

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

Change History

  Changed 3 years ago by mgood

#3555 has been marked as a duplicate.

  Changed 3 years ago by mgood

  • keywords webadmin removed
  • owner changed from daniel to cmlenz
  • component changed from trac-admin to webadmin
  • milestone set to 0.11

  Changed 3 years ago by anonymous

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.

follow-up: ↓ 6   Changed 3 years ago by 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?

  Changed 19 months ago by osimons

  • owner changed from cmlenz to osimons
  • priority changed from lowest to low
  • severity changed from trivial to minor

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   Changed 19 months ago by osimons

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.

Changed 19 months ago by osimons

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

  Changed 19 months ago by osimons

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 0.11.1 to 0.11

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

Closes ticket.

  Changed 19 months ago by osimons

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

  Changed 19 months ago by osimons

#4982 closed as duplicate.

Add/Change #2876 (WebAdmin: severity order selection field is invalid)

Author


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


Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from osimons. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.