Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#3544 closed defect (duplicate)

Ordering enums with 10+ values

Reported by: edgewall@… Owned by: daniel
Priority: low Milestone:
Component: admin/console Version: 0.9.6
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I just attempted to create ten different priority levels:

0 Critical
1 Highest
2 Higher
3 High
4 Normal
5 Low
6 Lower
7 Lowest
8 Deferred
9 Other

I did a bunch of priority add, priority change and priority order commands in trac-admin to take what we had and approach that list. But when I added the tenth value, it always sorted second, no matter how I did priority order. I believe this is because the enum table is:

CREATE TABLE enum (
    type text,
    name text,
    value text,
    UNIQUE (type,name)
);

The value column is what is used for sorting. It is a text, and as text, "10" sorts after "1" but before "2".

I'd suggest zero-padding the contents of the value column. (First 001, then 002, etc.) This is what I did manually to the sqlite database to get it to work.

Attachments (0)

Change History (2)

comment:1 by Emmanuel Blot, 18 years ago

Probable duplicate of #3382.

in reply to:  1 comment:2 by Matthew Good, 18 years ago

Resolution: duplicate
Status: newclosed

Replying to eblot:

Probable duplicate of #3382.

There's also #3490.

Modify Ticket

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