]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 293678: Sorting bug list by Assignee Real Name failing in latest nightly
authormkanat%kerio.com <>
Thu, 28 Jul 2005 13:20:12 +0000 (13:20 +0000)
committermkanat%kerio.com <>
Thu, 28 Jul 2005 13:20:12 +0000 (13:20 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wurblzap, a=justdave

Bugzilla/Search.pm

index ba06e475b79180aed152e6b0d2e83dd429145dd8..098cca7edba872b3b4a5f2543905406cbec808ae 100644 (file)
@@ -1304,6 +1304,13 @@ sub init {
     # to other parts of the query, so we want to create it before we
     # write the FROM clause.
     foreach my $orderitem (@inputorder) {
+        # Some fields have 'AS' aliases. The aliases go in the ORDER BY,
+        # not the whole fields.
+        # XXX - Ideally, we would get just the aliases in @inputorder,
+        # and we'd never have to deal with this.
+        if ($orderitem =~ /\s+AS\s+(.+)$/i) {
+            $orderitem = $1;
+        }
         BuildOrderBy($orderitem, \@orderby);
     }
     # Now JOIN the correct tables in the FROM clause.