summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-04-30 08:41:43 +0200
committerByron Jones <bjones@mozilla.com>2012-04-30 08:41:43 +0200
commit3b9a39da6dabb27ecf3ed4da7b6e2ea4eab750cd (patch)
tree00256b6f8d6cacb3fb50779d6d5e9b1544a85521
parent171ea61c9929ce12b5bf7988ed1c87183dbb1538 (diff)
downloadbugzilla-3b9a39da6dabb27ecf3ed4da7b6e2ea4eab750cd.tar.gz
bugzilla-3b9a39da6dabb27ecf3ed4da7b6e2ea4eab750cd.tar.xz
Bug 749074: Throw an error message instead of syntax error on invalid search type operators
r=LpSolit,a=LpSolit
-rw-r--r--Bugzilla/Search.pm4
-rw-r--r--template/en/default/global/code-error.html.tmpl4
2 files changed, 7 insertions, 1 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 1097b32dd..ae33875d9 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1747,7 +1747,9 @@ sub do_search_function {
sub _do_operator_function {
my ($self, $func_args) = @_;
my $operator = $func_args->{operator};
- my $operator_func = OPERATORS->{$operator};
+ my $operator_func = OPERATORS->{$operator}
+ || ThrowCodeError("search_field_operator_unsupported",
+ { operator => $operator });
$self->$operator_func($func_args);
}
diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl
index f09415cc2..73a602b87 100644
--- a/template/en/default/global/code-error.html.tmpl
+++ b/template/en/default/global/code-error.html.tmpl
@@ -467,6 +467,10 @@
[% ELSIF error == "invalid_post_bug_submit_action" %]
Invalid setting for post_bug_submit_action
+ [% ELSIF error == "search_field_operator_unsupported" %]
+ [% terms.Bugzilla %] does not support the search type
+ "[% operator FILTER html %]".
+
[% ELSE %]
[%# Try to find hooked error messages %]
[% error_message = Hook.process("errors") %]