From dddef33ef5bbbaba4e82d00ebe87877e474f5ea2 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Tue, 1 Mar 2011 07:41:44 -0800 Subject: Bug 637426: Fix every boolean chart operator type for the bug_group search field in Search.pm. (This also makes OR searches work against the bug_group field.) r=mkanat, a=mkanat --- Bugzilla/Search.pm | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 3af5b98cd..0262e7178 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -277,9 +277,7 @@ use constant OPERATOR_FIELD_OVERRIDE => { blocked => { _non_changed => \&_blocked_nonchanged, }, - bug_group => { - _non_changed => \&_bug_group_nonchanged, - }, + bug_group => MULTI_SELECT_OVERRIDE, classification => { _non_changed => \&_classification_nonchanged, }, @@ -2364,30 +2362,6 @@ sub _percentage_complete { $self->_add_extra_column('actual_time'); } -sub _bug_group_nonchanged { - my ($self, $args) = @_; - my ($chart_id, $joins, $field) = @$args{qw(chart_id joins field)}; - - my $map_table = "bug_group_map_$chart_id"; - - push(@$joins, { table => 'bug_group_map', as => $map_table }); - - my $groups_table = "groups_$chart_id"; - my $full_field = "$groups_table.name"; - $args->{full_field} = $full_field; - $self->_do_operator_function($args); - my $term = $args->{term}; - my $groups_join = { - table => 'groups', - as => $groups_table, - from => "$map_table.group_id", - to => 'id', - extra => [$term], - }; - push(@$joins, $groups_join); - $args->{term} = "$full_field IS NOT NULL"; -} - sub _attach_data_thedata { my ($self, $args) = @_; my ($chart_id, $joins) = @$args{qw(chart_id joins)}; @@ -2688,6 +2662,11 @@ sub _multiselect_table { return "bug_tag INNER JOIN tags ON bug_tag.tag_id = tags.id" . " AND user_id = " . $self->_user->id; } + elsif ($field eq 'bug_group') { + $args->{full_field} = 'groups.name'; + return "bug_group_map INNER JOIN groups + ON bug_group_map.group_id = groups.id"; + } my $table = "bug_$field"; $args->{full_field} = "bug_$field.value"; return $table; -- cgit v1.2.3-24-g4f1b