Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#7039 closed defect (fixed)

Milestone order in query reports

Reported by: ols@… Owned by: osimons
Priority: normal Milestone: 0.11
Component: report system Version: 0.11b2
Severity: normal Keywords:
Cc: ols@…, trac@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In Trac version 0.11b1 the milestones were ordered according to their due date in the custom query. In Trac version 0.11b2 the milestones are ordered alfabetically in the custom queries. I liked the 0.11b1 behaviour and hope that the 0.11b2 has a bug that will fixed soon.

Attachments (1)

t7039-r6788-query_changes-a.diff (4.3 KB ) - added by osimons 17 years ago.
Patch that reworks query caching by adding in sql instead of 'manually' updating afterwards

Download all attachments as: .zip

Change History (7)

comment:1 by anonymous, 17 years ago

I've found it happened from r6471. Here is instant patch.

  • ticket/query.py

     
    530530                groups.setdefault(group_key, []).append(ticket)
    531531                if not groupsequence or group_key not in groupsequence:
    532532                    groupsequence.append(group_key)
    533         groupsequence = sorted(groupsequence, reverse=self.groupdesc)
     533        #groupsequence = sorted(groupsequence, reverse=self.groupdesc)
    534534        groupsequence = [(value, groups[value]) for value in groupsequence]

But I think this is not right way.

comment:2 by Christian Boos, 17 years ago

Milestone: 0.110.11.1

No, this is not the right way, quoting from r6471:

any new group introduced by the change would not be sorted correctly.

The correct fix looks more involved, post-poning.

by osimons, 17 years ago

Patch that reworks query caching by adding in sql instead of 'manually' updating afterwards

comment:3 by osimons, 17 years ago

Owner: changed from Matthew Good to osimons

I think this patch works correct, and handles a number of other issues better - like the already closed issue of graceful removal of deleted tickets in #6088.

Comments?

comment:4 by Christian Boos, 17 years ago

Milestone: 0.11.10.11

I've tested it - seems to work great.

As discussed on IRC, this approach fixes a couple of other issues, like the quadratic behavior of L726 and the slowness of individual ticket retrieval of done at line 730. Also, I was not convinced of the correctness of the sorting done at line 735 (using the index in orig_list to insert into tickets list - tickets list might now well be completely different?). All this code is now gone ;-)

comment:5 by osimons, 17 years ago

Resolution: fixed
Status: newclosed

Superb. Committed in [6792].

comment:6 by trac@…, 17 years ago

Cc: trac@… added

I can confirm that the latests trunk fixs this problem.

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.