#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:
- Initial severities { critical: 1, major: 2, normal: 3, minor: 4 }
- Action: delete severity "normal"
- 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)
Change History (10)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Component: | trac-admin → webadmin |
---|---|
Keywords: | webadmin removed |
Milestone: | → 0.11 |
Owner: | changed from | to
comment:3 by , 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.
follow-up: 6 comment:4 by , 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 , 17 years ago
Owner: | changed from | to
---|---|
Priority: | lowest → low |
Severity: | trivial → 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
371 371 self.env.log.info('Deleting %s %s' % (self.type, self.name)) 372 372 cursor.execute("DELETE FROM enum WHERE type=%s AND value=%s", 373 373 (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)) 374 376 375 377 if handle_ta: 376 378 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?
comment:6 by , 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 , 17 years ago
Attachment: | t2876-r6286-enum_order-a.diff added |
---|
Reorder + delete default setting from trac.ini if that option is deleted (strictly not needed). Added some tests.
comment:7 by , 17 years ago
Milestone: | 0.11.1 → 0.11 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Implemented as [6317]. Ended up leaving the default setting in trac.ini as it does not interfere with anything.
Closes ticket.
#3555 has been marked as a duplicate.