]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 494643: Do not pass the same columns twice to the SQL query - Patch by FrédÃ...
authorlpsolit%gmail.com <>
Mon, 25 May 2009 17:02:59 +0000 (17:02 +0000)
committerlpsolit%gmail.com <>
Mon, 25 May 2009 17:02:59 +0000 (17:02 +0000)
buglist.cgi

index 2eee0edd99057ea43f66270084b734453b321a1b..531d1500cf4a965f705ca941cf53fcbb428e3695 100755 (executable)
@@ -824,7 +824,9 @@ if (lsearch(\@displaycolumns, "percentage_complete") >= 0) {
 }
 
 # Display columns are selected because otherwise we could not display them.
-push (@selectcolumns, @displaycolumns);
+foreach my $col (@displaycolumns) {
+    push (@selectcolumns, $col) if !grep($_ eq $col, @selectcolumns);
+}
 
 # If the user is editing multiple bugs, we also make sure to select the product
 # and status because the values of those fields determine what options the user
@@ -974,7 +976,7 @@ foreach my $fragment (split(/,/, $order)) {
             $fragment = $columns->{$fragment}->{'name'};
         }
 
-        push @selectnames, $fragment;
+        push(@selectnames, $fragment) unless (grep { $fragment eq $_ } @selectnames);
     }
 }