Closed Bug 232778 Opened 21 years ago Closed 19 years ago

sort order of a search is not saved

Categories

(Bugzilla :: Query/Bug List, defect)

2.17.6
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: ajschult784, Assigned: LpSolit)

Details

Attachments

(1 file)

When a query is saved, all the search parameters are saved... except the search order. It is always "Reuse same sort as last time", regardless of what was originally set on the query page. This doesn't hit me too much as I almost always use "last changed". In fact even when I perform a search and sort by something else, the saved queries (usually) still work, but I don't know why. :) To reproduce: 1. go to query page and do a query, select sort by "last changed." 2. save the search (*). 3. re-do the saved search (sort order is correct). 4. click Edit Search 5. notice sort order is now "Reuse same sort as last time" *) also note at step 2 that the GET URL used to save the search does not contain sort order information.
It strikes me as rather surprising that we have a bug of this severity left unfixed...
Assignee: justdave → jouni
Severity: normal → major
Target Milestone: --- → Bugzilla 2.20
I agree, this really should be fixed. Though at the moment people are living with it decently well enough (I certainly live with it OK, and I don't hear *constant* complaints about it), we should make it a priority to fix this for 2.22. If we fix it before 2.20 is released, I still think it would be valuable to backport it to the 2.20 branch.
Priority: -- → P2
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
This bug causes me pain because I use whine mail to send named queries to a mail alias. We want to be able to publish queries sorted by importance, as well as by assignee, but the since the named query doesn't remember sort order, this isn't possible. I've tried to hack whine.pl to see if we can at least get a default sort by importance via the 'order' parameter of Bugzilla::Search(), but I'm not doing the right thing. Any patch in this direction would be appreciated.
Apologies for not having the time to make this a patch or participate in this excellent open source project, but getting whine.pl to sort by importance is pretty easy. Modify whine.pl's invocation of Bugzilla::Search(): my $searchparams = new Bugzilla::CGI($savedquery); + + # hardwire default, sort by importance + my @orderstrings = ("bugs.priority", "bugs.bug_severity"); + my $search = new Bugzilla::Search( 'fields' => \@searchfields, 'params' => $searchparams, 'user' => $args->{'recipient'}, # the search runs as the recipient + 'order' => \@orderstrings, ); my $sqlquery = $search->getSQL(); $sth = $dbh->prepare($sqlquery); $sth->execute; But it would be very cool if the sort order would stick with the named query. By the way, the new whine functionality is great, even without sorting. Thanks!
Attached patch patch, v1Splinter Review
This patch allows you to have different saved searches with different sortkeys, and everytime you run one of these queries, its sort order is used instead of the current one. But you can still change the sort order of these queries, of course. Tested on 2.22. Works great.
Assignee: jouni → LpSolit
Status: NEW → ASSIGNED
Attachment #211112 - Flags: review?(bugreport)
It's a one-liner??? Why does that work?
(In reply to comment #6) > It's a one-liner??? Why does that work? > Because I'm very good! :-D Or more seriously because all the code to take the sort order into account already exists in buglist.cgi. The only thing which is missing is to store the sort order in the query itself (this one is removed by buglist.cgi, as you want to be able to change the sort order).
Attachment #211112 - Flags: review?(bugreport) → review+
Flags: approval?
Severity: major → minor
Priority: P2 → --
Flags: approval? → approval+
Checking in template/en/default/list/list.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list.html.tmpl,v <-- list.html.tmpl new revision: 1.45; previous revision: 1.44 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: