Closed Bug 470214 Opened 16 years ago Closed 14 years ago

Query sorting by multiple columns sometimes loses a column

Categories

(Bugzilla :: Query/Bug List, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: mozilla, Assigned: LpSolit)

References

Details

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

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) 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:

bugs.priority%2Cbugs.bug_severity%2Cmap_components.name%2Cbugs.short_desc

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

bugs.bug_severity%2Cmap_components.name%2Cbugs.short_desc

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

bugs.priority%2Cmap_components.name%2Cbugs.short_desc

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
Status: UNCONFIRMED → NEW
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
Status: NEW → RESOLVED
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 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.

@Frédéric:
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:

OK:
Bugzilla 3.0.10+ (https://landfill.bugzilla.org/bugzilla-3.0-branch/):
order=map_assigned_to.login_name%2Cbugs.priority%2Cbugs.bug_severity

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

OK:
Bugzilla 3.5.2+ (https://landfill.bugzilla.org/bugzilla-tip/)
order=assigned_to%2Cpriority%2Cbug_severity%2Cbug_status%2Cbug_id
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.
Status: RESOLVED → REOPENED
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://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.4/
modified template/en/default/list/table.html.tmpl
Committed revision 6719.
Status: REOPENED → RESOLVED
Closed: 15 years ago14 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: