Closed
Bug 206425
Opened 22 years ago
Closed 6 years ago
Allow sorting shared / saved searches in the footer
Categories
(Bugzilla :: Query/Bug List, enhancement, P4)
Bugzilla
Query/Bug List
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: johan.runnedahl, Unassigned)
Details
(Whiteboard: [good first bug])
Attachments
(1 file, 3 obsolete files)
4.55 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Build Identifier:
At the bottom of each page in the yellow box it is possible to store or
remember preset queries.
However, they are not sorted in any particular order other than creation order.
It would be a nice with some possibility for the user to sort the queries.
Suggestion: This could be done, either by just sorting them alphabetically or
give the user the possibility to sort them with a sortkey.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1•22 years ago
|
||
Looking at my stored queries they appear to be sorted in alphabetical order...
Confirming enhancement request for a sortkey.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 2•21 years ago
|
||
Looking at my stored queries they are not sorted in alphabetical order.
A sort key sounds good. But a first step might be to have the actual alphabetic
ordering. If such a step would not be to much sunk work.
Comment 3•21 years ago
|
||
I'm seeing this problem as well. I tried to modify the template files myself
but am not familiar enough with the syntax.
The current order is 'My Bugs' first, followed by the rest of the queries,
alphabetically (see Bugzilla/User.pm:154)
Reporter | ||
Comment 5•21 years ago
|
||
I am runnig Bugzilla v 2.16.3 and my Preset Queries are not sorted
alphabetically. This is the, non-alphabetic, order of my first 5 queries.
"My Bugs |
To be verified by me |
Verified or closed by me |
CC to me |
Really bugs "
I was talking about the latest version in CVS - sorry!
If you had access, and wanted to make 2.16.3 sort alphabetically, I think that
the change would be at about line 498 of CGI.pl
Updated•21 years ago
|
Assignee: endico → nobody
Comment 7•19 years ago
|
||
That's something I would like to see fixed for 2.24. I have around 25 saved searches and having them sorted alphabetically is painful.
Assignee: nobody → query-and-buglist
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: --- → Bugzilla 2.24
Comment 9•19 years ago
|
||
paul, read comment 1. The goal here is to add a sortkey so that you can sort them in any order you want, not only alphabetically.
I have saved searches about different topics, and I would like to sort them by topic. And AFAIK, this doesn't work for me on tip. ;)
Comment 10•19 years ago
|
||
From the discussion, I wasn't sure that was the goal of the bug.
Attachment #206626 -
Flags: review?(LpSolit)
Comment 11•19 years ago
|
||
Comment on attachment 206626 [details] [diff] [review]
patch for tip
>Index: userprefs.cgi
>+ my $sortord = $cgi->param("sortkey_$q->{'name'}");
>+ if ( defined($sortord) ) {
>+ # detaint it
>+ $sortord = ($sortord =~ m/^([\-\+]{0,1}[0-9]+)$/) ? $1 : 0 ;
>+ }
>+ else {
>+ $sortord = 0;
>+ }
>+
>+ my $qrysortkey = defined($cgi->param("sortkey_$q->{'name'}")) ? $sortord : 0;
$sortord should be an integer (no negative values allowed), so use detaint_natural() for that. And then use this value directly in the SQL query. As the default is 0 already, you don't have to care whether detaint_natural() will return undef or a number.
>Index: Bugzilla/User.pm
> my $sth = $dbh->prepare(q{ SELECT
>- DISTINCT name, query, linkinfooter, query_type,
>+ DISTINCT name, query, linkinfooter, query_type,
Nit: please don't add trailing whitespaces.
Moreover, User::queries() has changed a lot. This patch no longer applies cleanly on tip.
>Index: template/en/default/account/prefs/saved-searches.html.tmpl
>+ <th>
>+ Sort Order
>+ </th>
In all other places, we write "Sortkey" or "Sort Key". Use one of them here too.
>+ <td align="center">
>+ <input id="sortkey" size="20" maxlength="20" name="sortkey_[% q.name FILTER html %]" value="[% q.sortkey %]">
>+ </td>
You restrict sortkeys to small integers. I don't think a number with 20 characters will fit in a small integer!
Attachment #206626 -
Flags: review?(LpSolit) → review-
Comment 12•19 years ago
|
||
Attachment #206626 -
Attachment is obsolete: true
Attachment #207935 -
Flags: review?(LpSolit)
Comment 13•19 years ago
|
||
Comment on attachment 207935 [details] [diff] [review]
refreshed from bitrot, changed the size of the field,used detaint_signed
>Index: checksetup.pl
>+# 2005-12-22 pdemarco@ppg.com - Bug 206425
>+$dbh->bz_add_column('namedqueries', 'sortkey',
>+ {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0});
>+
> # 2005-11-04 LpSolit@gmail.com - Bug 305927
Nit: please respect the chronological order and move this part right before --TABLE--.
>Index: userprefs.cgi
>+ my $sortord = $cgi->param("sortkey_$q->{'name'}");
>+ detaint_signed($sortord);
The sortkey should be positive, and so you should use detaint_natural(). The reason we allowed negative sortkeys for target milestones was because you could have miletones in the past and in the future. But I see no good reason to allow them for saved searches.
>Index: template/en/default/account/prefs/saved-searches.html.tmpl
>+ <td align="center">
>+ <input id="sortkey" size="5" maxlength="5" name="sortkey_[% q.name FILTER html %]" value="[% q.sortkey %]">
>+ </td>
q.sortkey is not filtered. This makes runtests.pl to complain:
not ok 22 - (en/default) template/en/default/account/prefs/saved-searches.html.tmpl has unfiltered directives:
# 93: q.sortkey
# --ERROR
Attachment #207935 -
Flags: review?(LpSolit) → review-
Comment 14•19 years ago
|
||
(In reply to comment #13)
> >+ <td align="center">
> >+ <input id="sortkey" size="5" maxlength="5" name="sortkey_[% q.name FILTER html %]" value="[% q.sortkey %]">
> >+ </td>
Also, split this long line.
Status: NEW → ASSIGNED
Comment 15•19 years ago
|
||
Attachment #207935 -
Attachment is obsolete: true
Attachment #207953 -
Flags: review?(LpSolit)
Comment 16•19 years ago
|
||
Attachment #207953 -
Attachment is obsolete: true
Attachment #207955 -
Flags: review?(LpSolit)
Attachment #207953 -
Flags: review?(LpSolit)
Comment 17•19 years ago
|
||
Comment on attachment 207955 [details] [diff] [review]
detaint_natural's return needed to check for undef for inserts
works fine. Thanks for the patch. r=LpSolit
Attachment #207955 -
Flags: review?(LpSolit) → review+
Updated•19 years ago
|
Flags: approval?
Comment 18•19 years ago
|
||
I don't like the end-user UI on this much. The average user is going to be confused by "sort key". What would work better is if we just automatically assign them and have "move up" and "move down" widgets in the saved searches manager in the prefs. Default them to alphabetical of course, we don't need to renumber them all until the first time the user tries to change them.
Flags: approval?
Comment 19•19 years ago
|
||
(In reply to comment #18)
> I don't like the end-user UI on this much. The average user is going to be
> confused by "sort key". What would work better is if we just automatically
> assign them and have "move up" and "move down" widgets in the saved searches
> manager in the prefs. Default them to alphabetical of course, we don't need to
> renumber them all until the first time the user tries to change them.
This is working in the standard way all other ordering is done in Bugzilla. A "move up" and "move down" should be a separate bug and applied to all sorting activities.
Comment 21•18 years ago
|
||
(In reply to comment #18)
> I don't like the end-user UI on this much.
Enough to give it review-? If so, please mark as such. Otherwise, let's approve and iteratively improve.
Comment 22•18 years ago
|
||
(In reply to comment #21)
> (In reply to comment #18)
> > I don't like the end-user UI on this much.
> Enough to give it review-? If so, please mark as such. Otherwise, let's
> approve and iteratively improve.
The problem is that more and more stuff is using the exact same mechanism to order things. How can you choose this bug to stand on to say it's not good UI? Why have the others been allowed? and continue to be allowed?
There's no reason for my work to be wasted.
Commit and then create a new bug if you must.
Comment 23•18 years ago
|
||
yeah, agreed. Consistency matters. We need to go through and fix them all at once so people stop copying it. :)
But this patch is so bitrotted it's not funny right now... let's get it updated.
Flags: approval?
Comment 24•18 years ago
|
||
This bug is retargetted to Bugzilla 3.2 for one of the following reasons:
- it has no assignee (except the default one)
- we don't expect someone to fix it in the next two weeks (i.e. before we freeze the trunk to prepare Bugzilla 3.0 RC1)
- it's not a blocker
If you are working on this bug and you think you will be able to submit a patch in the next two weeks, retarget this bug to 3.0.
If this bug is something you would like to see implemented in 3.0 but you are not a developer or you don't think you will be able to fix this bug yourself in the next two weeks, please *do not* retarget this bug.
If you think this bug should absolutely be fixed before we release 3.0, either ask on IRC or use the "blocking3.0 flag".
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
Comment 26•17 years ago
|
||
afaict, bug 69000 massacred this patch. I think the options are hijacking the namedqueries_link_in_footer table, or creating yet another table.
I think I'd rather hijack it (which probably includes adding two fields, one being a boolean for link in footer).
I don't particularly like the idea of creating dozens of tables each time a query needs a new property.
Comment 27•17 years ago
|
||
removing UE keyword because it doesn't ask for changes in the UI, but asks for functionality that normally works, to also work for a 'special' case.
Keywords: ue
Comment 28•17 years ago
|
||
Bugzilla 3.2 is now frozen. Only enhancements blocking 3.2 or specifically approved for 3.2 may be checked in to the 3.2 branch. If you would like to nominate your enhancement for Bugzilla 3.2, set the "blocking3.2" flag to "?", and either the target milestone will be changed back, or the blocking3.2 flag will be granted, if we will accept this enhancement for Bugzilla 3.2.
Target Milestone: Bugzilla 3.2 → Bugzilla 4.0
Updated•15 years ago
|
Whiteboard: [needs new patch]
Comment 29•15 years ago
|
||
Honestly, I'm not even sure the code complexity of such a feature is really worth it.
Priority: -- → P4
Summary: Remembered or preset query / queries in the footer are not possible to sort → Allow sorting shared / saved searches in the footer
Target Milestone: Bugzilla 4.0 → ---
Comment 30•10 years ago
|
||
(In reply to Max Kanat-Alexander from comment #29)
> Honestly, I'm not even sure the code complexity of such a feature is really
> worth it.
agreed.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Comment 32•10 years ago
|
||
Paul: Why? And why do you think that a lot of people would ever use this?
Comment 33•10 years ago
|
||
(In reply to Andre Klapper from comment #32)
> Paul: Why? And why do you think that a lot of people would ever use this?
See the long list of users in the CC list + comments 0, 3, 7. Users with tens of saved searches probably want to order them (I do), as already explained in comment 7.
Updated•8 years ago
|
Keywords: good-first-bug,
outreachy
Whiteboard: [needs new patch] → [good first bug]
Comment 34•6 years ago
|
||
Removing good-first-bug
keyword because team does not have bandwidth to mentor at the moment.
Keywords: good-first-bug
Comment 35•6 years ago
|
||
Removing outreachy
because team does not have bandwidth to mentor this cycle.
Keywords: outreachy
Comment 36•6 years ago
|
||
The global footer has been removed.
Status: REOPENED → RESOLVED
Closed: 10 years ago → 6 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•