Query sorting by multiple columns sometimes loses a column

RESOLVED FIXED in Bugzilla 3.4



11 years ago
9 years ago


(Reporter: mozilla, Assigned: LpSolit)



Dependency tree / graph
Bug Flags:
approval3.4 +


(Whiteboard: [3.4 only; 3.6 fixed by bug 164009])


(1 attachment)



11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2008120122 Firefox/3.0.5
Build Identifier: 

I normally like to sort first by prio, then by sev, then by component, and finally by summary.  So I just click those column headings in the reverse order.  This prepends the following to my LASTORDER cookie in 3.0.3:


In 3.2, after clicking the column headings for summary, component, and severity, my LASTORDER cookie starts with:


If I then click the priority heading, the severity sort key gets lost:


Reproducible: Always

Initially reported in bug 164009 comment 16.


11 years ago
Version: unspecified → 3.2
I can confirm this happening in current trunk verison. There's some funky things going on with the order parameter when there's multiple order columns. Same funkiness can be seen on the URL order param, which then gets stored in LASTORDER cookie.

I have a feeling that this might get fixed by the patch in bug 164009 but we'll see.
Assignee: query-and-buglist → wicked
Severity: normal → minor
Depends on: 164009
Ever confirmed: true
OS: Windows Vista → All
Hardware: x86 → All
This is caused by a regression introduced by 23473 since it eagerly modifies the global order variable when using order.remove() to remove duplicate columns. This then affects rest of the columns after the first column from the current sort order.

As I suspected this is fixed by the latest patch in bug 164009.
Depends on: 23473
Keywords: regression
Whiteboard: [blocker will fix]

Comment 3

10 years ago
(In reply to comment #2)
> As I suspected this is fixed by the latest patch in bug 164009.

The relevant part of this patch, which I suppose is the regexp, has been fixed separately in bug 510944, so I'm pretty sure this is now fixed in Bugzilla 3.4.2.
Assignee: wicked → LpSolit
Last Resolved: 10 years ago
Depends on: 510944
No longer depends on: 164009
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 3.4

Comment 4

10 years ago
This is still not working in 3.4.4+, but is fixed on trunk.  I don't have permission to change the target milestone, and I'm not sure whether this warrants a reopen for further work on the 3.4 branch, so I'll let others decide how to handle it.

Running the query https://landfill.bugzilla.org/bugzilla-3.4-branch/buglist.cgi?query_format=advanced&bug_status=ASSIGNED&product=FoodReplicator and using http://addneditcookies.mozdev.org/ to look at my cookies, I see:

0. COLUMNLIST=bug_severity%20priority%20assigned_to_realname%20bug_status%20resolution%20component%20target_milestone%20status_whiteboard%20keywords%20short_desc
1. LASTORDER=bug_id
2. click the "summary" header
3. LASTORDER=short_desc%2Cbug_id
4. click the "comp" header
5. LASTORDER=component%2Cshort_desc%2Cbug_id
6. click the "sev" header
7. LASTORDER=bug_severity%2Ccomponent%2Cshort_desc%2Cbug_id
8. click the "pri" header
9. LASTORDER=priority%2Ccomponent%2Cshort_desc%2Cbug_id

On https://landfill.bugzilla.org/bugzilla-tip, I instead see:
9. LASTORDER=priority%2Cbug_severity%2Ccomponent%2Cshort_desc%2Cbug_id
> (In reply to comment #2)
> The relevant part of this patch, which I suppose is the regexp, has been fixed
> separately in bug 510944, so I'm pretty sure this is now fixed in Bugzilla
> 3.4.2.

Please reopen this bug as it is definitely not fixed in Bugzilla 3.4.4+ (also see comment 4). Comparing the order parameter in the URL on four different Bugzilla versions after clicking Pri, Sev, Assignee:

Bugzilla 3.0.10+ (https://landfill.bugzilla.org/bugzilla-3.0-branch/):

Not OK:
Bugzilla 3.2.5+ (https://landfill.bugzilla.org/bugzilla-3.2-branch/):
order=map_assigned_to.login_name desc%2Cbugs.bug_status%2Cbugs.bug_id

Not OK:
Bugzilla 3.4.4+ (https://landfill.bugzilla.org/bugzilla-3.4-branch/):
order=assigned_to DESC%2Cbug_status%2Cbug_id

Bugzilla 3.5.2+ (https://landfill.bugzilla.org/bugzilla-tip/)

Comment 6

9 years ago
OK, you're right; this bug is not fixed on the 3.4 branch. 3.5.2 is not affected thanks to bug 164009. I have a patch for 3.4.5.
Depends on: 164009
Resolution: FIXED → ---
Whiteboard: [blocker will fix] → [3.4 only; 3.6 fixed by bug 164009]

Comment 7

9 years ago
Posted patch patch, v1Splinter Review
We must not replace $order by its trimmed value. This patch is similar to what has been done upstream. wicked: this patch is for the 3.4 branch only, see my previous comment.
Attachment #423381 - Flags: review?(wicked)


9 years ago
Attachment #423381 - Flags: review?(wicked) → review?(ghendricks)


9 years ago
Attachment #423381 - Flags: review?(ghendricks) → review+


9 years ago
Flags: approval3.4+

Comment 8

9 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.4/
modified template/en/default/list/table.html.tmpl
Committed revision 6719.
Last Resolved: 10 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.