Closed Bug 470214 Opened 16 years ago Closed 14 years ago

Query sorting by multiple columns sometimes loses a column


(Bugzilla :: Query/Bug List, defect)

Not set



Bugzilla 3.4


(Reporter: mozilla, Assigned: LpSolit)



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


(1 file)

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.
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]
(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
Closed: 15 years ago
Depends on: 510944
No longer depends on: 164009
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 3.4
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 and using 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, 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+ (

Not OK:
Bugzilla 3.2.5+ (
order=map_assigned_to.login_name desc%2Cbugs.bug_status%2Cbugs.bug_id

Not OK:
Bugzilla 3.4.4+ (
order=assigned_to DESC%2Cbug_status%2Cbug_id

Bugzilla 3.5.2+ (
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]
Attached 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)
Attachment #423381 - Flags: review?(wicked) → review?(ghendricks)
Attachment #423381 - Flags: review?(ghendricks) → review+
Flags: approval3.4+
Committing to: bzr+ssh://
modified template/en/default/list/table.html.tmpl
Committed revision 6719.
Closed: 15 years ago14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.