]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 577602: Don't put multi-select fields into the GROUP BY in Search.pm,
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 10 Jul 2010 05:07:51 +0000 (22:07 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 10 Jul 2010 05:07:51 +0000 (22:07 -0700)
because they are created by an aggregate. (This fixes multi-select buglist
columns on Pg.)
r=mkanat, a=mkanat (module owner)

Bugzilla/Search.pm

index 63e4586553f1210f8a09b2caab0eb92489c45e6f..c41579efe46554dadfc47f75d1fb70d4cf8691f4 100644 (file)
@@ -1119,8 +1119,12 @@ sub init {
     foreach my $field (@fields) {
         # These fields never go into the GROUP BY (bug_id goes in
         # explicitly, below).
-        next if (grep($_ eq $field, EMPTY_COLUMN, 
-                      qw(bug_id actual_time percentage_complete flagtypes.name keywords)));
+        my @skip_group_by = (EMPTY_COLUMN, 
+            qw(bug_id actual_time percentage_complete flagtypes.name
+               keywords));
+        push(@skip_group_by, map { $_->name } @$multi_select_fields);
+
+        next if grep { $_ eq $field } @skip_group_by;
         my $col = COLUMNS->{$field}->{name};
         push(@groupby, $col) if !grep($_ eq $col, @groupby);
     }