Closed
Bug 302326
Opened 20 years ago
Closed 20 years ago
Column sort links in bug lists should use field IDs instead of names
Categories
(Bugzilla :: Query/Bug List, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: Wurblzap, Assigned: Wurblzap)
References
Details
Attachments
(1 file)
|
3.72 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
This is a spinoff of bug 293678.
You can sort bug lists by clicking on the column header you want to sort on.
This adds the field name to a CGI parameter (order). Some field names are very
long because they contain formulas. In order to avoid triggering bug 284667
prematurely, I think it would be a good idea to use field IDs instead of field
names. Because field IDs and their aliases are identical, the ORDER BY clause
would continue to work like it does.
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #190692 -
Flags: review?
| Assignee | ||
Updated•20 years ago
|
Severity: normal → minor
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.22
Version: 2.19.3 → 2.21
| Assignee | ||
Comment 2•20 years ago
|
||
This patch probably doesn't work completely yet, it's more of a proof of concept.
Comment 3•20 years ago
|
||
I think
Updated•20 years ago
|
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Comment 4•20 years ago
|
||
From my point of view, this bug is not an enhancement, but a real bug fix, see bug 289602. As we now support different DBs (MySQL and PostgreSQL, and soon Oracle), our queries must be DB-independent and so we should stop having SQL fragments in URLs (which is the reason of bug 289602).
This fix is the only one which doesn't look like another hack!
Severity: minor → normal
Target Milestone: Bugzilla 2.24 → Bugzilla 2.20
Updated•20 years ago
|
Attachment #190692 -
Flags: review?(LpSolit)
Comment 5•20 years ago
|
||
Comment on attachment 190692 [details] [diff] [review]
Patch
>Index: template/en/default/list/table.html.tmpl
>+ [% IF column.name.match('\s+AS\s+') %]
>+ [%# For aliased columns, use their ID for sorting. %]
>+ [% column.sortalias = id %]
>+ [% ELSE %]
>+ [%# Other columns may sort on their name directly. %]
>+ [% column.sortalias = column.name %]
>+ [% END %]
> <a href="buglist.cgi?[% urlquerypart FILTER html %]&order=
>- [% column.name FILTER url_quote FILTER html %]
>+ [% column.sortalias FILTER url_quote FILTER html %]
Nit: why not using column.id in all cases? buglist.cgi would convert it back to SQL fragments and this way we would *really* be DB-independent.
Tested on tip with MySQL and PostgreSQL and on 2.20+ with MySQL. Works great! And sorting by deadline works fine too (as well as other aliases).
Great patch, Marc! r=LpSolit
Attachment #190692 -
Flags: review?(LpSolit)
Attachment #190692 -
Flags: review?
Attachment #190692 -
Flags: review+
Updated•20 years ago
|
Flags: approval?
Flags: approval2.20?
Comment 6•20 years ago
|
||
yay, this one always annoyed me. :)
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
Comment 7•20 years ago
|
||
I didn't hear from you for several days now, Marc. So I assume you are already on vacation. Happy New Year! :)
tip:
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v <-- buglist.cgi
new revision: 1.321; previous revision: 1.320
done
Checking in template/en/default/list/table.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/table.html.tmpl,v <-- table.html.tmpl
new revision: 1.28; previous revision: 1.27
done
2.20:
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v <-- buglist.cgi
new revision: 1.299.2.6; previous revision: 1.299.2.5
done
Checking in template/en/default/list/table.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/table.html.tmpl,v <-- table.html.tmpl
new revision: 1.27.2.1; previous revision: 1.27
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•