]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 238544: Emit appropriate error if content and matches are used in
authorbugreport%peshkin.net <>
Thu, 22 Jul 2004 13:48:59 +0000 (13:48 +0000)
committerbugreport%peshkin.net <>
Thu, 22 Jul 2004 13:48:59 +0000 (13:48 +0000)
            invalid search combinations.
r=jouni
a=justdave

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

index bf81451aec8728eebe164d306654b878912873ac..49f32fdf8fbfda9cd486f406160e18c93a99ff77 100644 (file)
@@ -478,6 +478,9 @@ sub init {
                  push(@fields, $select_term);
              }
          },
+         "^content," => sub {
+             ThrowUserError("search_content_without_matches");
+         },
          "^commenter,(?:equals|anyexact),(%\\w+%)" => sub {
              my $match = pronoun($1, $user);
              my $chartseq = $chartid;
@@ -828,6 +831,9 @@ sub init {
          ",lessthan" => sub {
              $term = "$ff < $q";
          },
+         ",matches" => sub {
+             ThrowUserError("search_content_without_matches");
+         },
          ",greaterthan" => sub {
              $term = "$ff > $q";
          },
index ed95724fb34a31777c970fe663d173f67e9541ca..503715ba226f44f8e8e27d80a291dc37a6f543b5 100644 (file)
     [% title = "Access Denied" %]
     You do not have the permissions necessary to run a sanity check.
 
+  [% ELSIF error == "search_content_without_matches" %]
+    [% title = "Illegal Search" %]
+    The "content" field can only be used with "matches" search 
+    and the "matches" search can only be used with the "content"
+    field.
+
   [% ELSIF error == "series_already_exists" %]
     [% title = "Series Already Exists" %]
       A series named <em>[% series.category FILTER html %] /