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)

2.21
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: Wurblzap, Assigned: Wurblzap)

References

Details

Attachments

(1 file)

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.
Attached patch PatchSplinter Review
Attachment #190692 - Flags: review?
Severity: normal → minor
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.22
Version: 2.19.3 → 2.21
This patch probably doesn't work completely yet, it's more of a proof of concept.
I think
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Blocks: 289602
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
Attachment #190692 - Flags: review?(LpSolit)
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 %]&amp;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+
Flags: approval?
Flags: approval2.20?
yay, this one always annoyed me. :)
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
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.

Attachment

General

Created:
Updated:
Size: