diff options
Diffstat (limited to 'Bugzilla/Search')
-rw-r--r-- | Bugzilla/Search/Condition.pm | 9 | ||||
-rw-r--r-- | Bugzilla/Search/Quicksearch.pm | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/Bugzilla/Search/Condition.pm b/Bugzilla/Search/Condition.pm index 4975775af..eab4ab79d 100644 --- a/Bugzilla/Search/Condition.pm +++ b/Bugzilla/Search/Condition.pm @@ -21,9 +21,16 @@ sub new { } sub field { return $_[0]->{field} } -sub operator { return $_[0]->{operator} } sub value { return $_[0]->{value} } +sub operator { + my ($self, $value) = @_; + if (@_ == 2) { + $self->{operator} = $value; + } + return $self->{operator}; +} + sub fov { my ($self) = @_; return ($self->field, $self->operator, $self->value); diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index d073720a1..3133b1a6b 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -364,8 +364,15 @@ sub _handle_field_names { my ($or_operand, $negate, $unknownFields, $ambiguous_fields) = @_; # Flag and requestee shortcut - if ($or_operand =~ /^(?:flag:)?([^\?]+\?[^\?]*)$/) { - addChart('flagtypes.name', 'substring', $1, $negate); + if ($or_operand =~ /^(?:flag:)?([^\?]+\?)([^\?]*)$/) { + my ($flagtype, $requestee) = ($1, $2); + addChart('flagtypes.name', 'substring', $flagtype, $negate); + if ($requestee) { + # AND + $chart++; + $and = $or = 0; + addChart('requestees.login_name', 'substring', $requestee, $negate); + } return 1; } |