From a7859e10d9456dbe17373ebfdd1a22cc88a4c754 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Fri, 10 May 2013 16:18:12 +0800 Subject: Bug 828344: "contains all of the words" no longer looks for all words within the same comment or flag r=LpSolit, a=LpSolit --- Bugzilla/Search/Condition.pm | 9 ++++++++- Bugzilla/Search/Quicksearch.pm | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Search') 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; } -- cgit v1.2.3-24-g4f1b