summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-06 01:34:43 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-06 01:34:43 +0200
commit9d74567bea1df66f4572fe526d18c21c87bde799 (patch)
treead6ba2a847cc4b1d7eefe0aa7c82d7638786819a
parent97fc35368cde9f7d5bd98c91ef4fa9d29786bc34 (diff)
downloadbugzilla-9d74567bea1df66f4572fe526d18c21c87bde799.tar.gz
bugzilla-9d74567bea1df66f4572fe526d18c21c87bde799.tar.xz
Bug 562014: Fix negative keyword searches like "contains none of the words"
to properly find bugs with *none* of the listed keywords, and also to find bugs with no keywords at all. r=LpSolit, a=LpSolit
-rw-r--r--Bugzilla/Search.pm27
1 files changed, 20 insertions, 7 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 90d22c38c..61f5e995e 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -155,12 +155,17 @@ use constant OPERATOR_FIELD_OVERRIDE => {
},
keywords => {
equals => \&_keywords_exact,
- notequals => \&_keywords_exact,
anyexact => \&_keywords_exact,
- anywords => \&_keywords_exact,
+ anyword => \&_keywords_exact,
allwords => \&_keywords_exact,
- nowords => \&_keywords_exact,
- _non_changed => \&_keywords_nonchanged,
+
+ notequals => \&_multiselect_negative,
+ notregexp => \&_multiselect_negative,
+ notsubstring => \&_multiselect_negative,
+ nowords => \&_multiselect_negative,
+ nowordssubstr => \&_multiselect_negative,
+
+ _non_changed => \&_keywords_nonchanged,
},
'flagtypes.name' => {
_default => \&_flagtypes_name,
@@ -2052,7 +2057,7 @@ sub _keywords_exact {
my %func_args = @_;
my ($chartid, $v, $ff, $f, $t, $term, $supptables) =
@func_args{qw(chartid v ff f t term supptables)};
-
+
my @list;
my $table = "keywords_$$chartid";
foreach my $value (split(/[\s,]+/, $$v)) {
@@ -2202,8 +2207,16 @@ sub _multiselect_negative {
nowordssubstr => 'anywordssubstr',
);
- my $table = "bug_$$f";
- $$ff = "$table.value";
+ my $table;
+ if ($$f eq 'keywords') {
+ $table = "keywords LEFT JOIN keyworddefs"
+ . " ON keywords.keywordid = keyworddefs.id";
+ $$ff = "keyworddefs.name";
+ }
+ else {
+ $table = "bug_$$f";
+ $$ff = "$table.value";
+ }
$$t = $map{$$t};
$self->_do_operator_function(\%func_args);