Closed Bug 146091 Opened 22 years ago Closed 22 years ago

Sort order for votes is ascending instead of descending.

Categories

(Bugzilla :: Query/Bug List, defect, P2)

2.15
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: CodeMachine, Assigned: endico)

Details

(Keywords: regression)

Attachments

(1 file)

When you choose to sort on votes by clicking on the column heading on
buglist.cgi, it ends up sorting in ascending order rather than descending order
as you would expect.

I believe this is a regression, as it works on mozilla.org.
Keywords: regression
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.16
Myk did this, adding him.

There is a comment in the source about adding DESC to votes, but it isn't
actually done anymore.
Sorry I was mistaken there is code for it.  It's:

    # If we are sorting by votes, sort in descending order.
    if ($db_order =~ /bugs.votes\s+(asc|desc){0}/i) {
        $db_order =~ s/bugs.votes/bugs.votes desc/i;
    }

What does the {0} mean?  Wouldn't that make what occurs before get ignored, and
the regexp in effect be /bugs.votes\s+/ ?  Or is that something to prevent
greediness?

Even besides that this is possibly because asc no longer appears normally.
This patch fixes the problem by not requiring whitespace between the field name
and the (optional) ascending/descending marker.
Comment on attachment 84650 [details] [diff] [review]
patch v1: fixes problem

2xr=gerv.

Gerv
Attachment #84650 - Flags: review+
Checked in on trunk and branch.

Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.169.2.3; previous revision: 1.169.2.2
done

Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.172; previous revision: 1.171
done

Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: