summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-04-05 09:09:22 +0200
committerterry%mozilla.org <>2000-04-05 09:09:22 +0200
commit55ab6c6d1753d5cdffc7830df734bdcecb7bfd4e (patch)
treeb4d489f04691300b2ad9abfcee4cd042247d8e0e /buglist.cgi
parenta5782052f5e288a75b567b97b2f264fd55ad6611 (diff)
downloadbugzilla-55ab6c6d1753d5cdffc7830df734bdcecb7bfd4e.tar.gz
bugzilla-55ab6c6d1753d5cdffc7830df734bdcecb7bfd4e.tar.xz
Extra special disgusting hack: if we are ordering by target_milestone,
change it to order by the sortkey of the target_milestone first.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi11
1 files changed, 10 insertions, 1 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 5171e7fee..023d06755 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -910,7 +910,16 @@ if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
}
die "Invalid order: $::FORM{'order'}" unless
$::FORM{'order'} =~ /^([a-zA-Z0-9_., ]+)$/;
- $query .= $::FORM{'order'};
+
+ # Extra special disgusting hack: if we are ordering by target_milestone,
+ # change it to order by the sortkey of the target_milestone first.
+ my $order = $::FORM{'order'};
+ if ($order =~ /bugs.target_milestone/) {
+ $query =~ s/ WHERE / LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product = bugs.product WHERE /;
+ $order =~ s/bugs.target_milestone/ms_order.sortkey,ms_order.value/;
+ }
+
+ $query .= $order;
}