]> 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:41:43 +0000 (14:41 +0800)
committerByron Jones <bjones@mozilla.com>
Mon, 30 Apr 2012 06:41:43 +0000 (14:41 +0800)
r=LpSolit,a=LpSolit

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

index 1097b32dda49346028345dbe259f3d535e4a4fd1..ae33875d941fff8ed7a291713565c681f87ce3a0 100644 (file)
@@ -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);
 }
 
index f09415cc230e4c5827673a95b9014861703abfd4..73a602b8700a320e2b2788558c1ae7d7b828833c 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") %]