Modify

Opened 11 years ago

Closed 5 years ago

#1306 closed defect (wontfix)

Incorrect sorting by priority

Reported by: Sagrer Owned by: Noah Kantrowitz
Priority: normal Component: PaginateTicketsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I installed r2099 into trac 0.10.3

Sorting by priority works incorrectly - for example if i has tickets with highest, high, normal and low priority - when i request a query (from roadmap page, all active tickets of milestone) - it shows me in a table - first 2 tickets are with highest priority, but i has 6 tickets with highest priority... this tickets are in different other places of a table (120 tickets in a table at all, i did request for 120 tickets for a page, but if it was 10 tickets for a page - problem exists too)... similar is with all other tickets and priorityes... for example i has only 1 ticket with low priority - it is situated in a first part of table, after ticket with normal priority, and before ticket with normal priority...

P.S. - it is an up-arrow in a first cell of "Priority" column in a table - so, sorting must be by this column...

Attachments (0)

Change History (3)

comment:1 Changed 11 years ago by Sagrer

sorry, forgot to say: priorityes names a renamed, with not english characters (cyrillic).

comment:2 Changed 11 years ago by Akihiro KAYAMA

Because tickets are indexed as usual list in HDF dataset, but paginate re-sorts them as a string, so ticket order is broken when there are more than 10 tickets. (like 0 1 11 12 2 3 4 5 6 7 8 9)

This patch solves this problem in inefficent way.

--- paginateticketsplugin/0.10/paginate/web_ui.py.orig	2006-09-04 02:54:38.000000000 +0900
+++ paginateticketsplugin/0.10/paginate/web_ui.py	2007-03-14 16:46:58.000000000 +0900
@@ -40,7 +40,8 @@
                     node = node.next()
                 return ret                
             results_dict = walk_hdf(req.hdf.getObj('query.results').child())
-            results = [results_dict[k] for k in sorted(results_dict.keys())]
+            results = [results_dict[str(k)] for k in
+                       sorted([int(key) for key in results_dict.keys()])]
 
             # Update/retrieve the number of tickets per page
             perpage = req.session.get('tickets_perpage')

comment:3 Changed 5 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

This plugin is deprecated with Trac 0.11. The functionality was integrated to the Trac core in t:#216.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.