]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 749074: Throw an error message instead of syntax error on invalid search type...
authorByron Jones <bjones@mozilla.com>
Mon, 30 Apr 2012 06:43:29 +0000 (14:43 +0800)
committerByron Jones <bjones@mozilla.com>
Mon, 30 Apr 2012 06:43:29 +0000 (14:43 +0800)
r=LpSolit,a=LpSolit

Bugzilla/Search.pm
template/en/default/global/code-error.html.tmpl

index e42952347fa1207e51e8c6cd9bed22d1d6dc6999..9024afb289e02934b23c603446bec50363d1228d 100644 (file)
@@ -1779,7 +1779,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);
 }
 
index 19d0628414151ffdc669be2b4d3b3f474a722fe7..9fd32605142797cad2b05ecd10f3ca072102376b 100644 (file)
   [% 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") %]