diff options
author | bugreport%peshkin.net <> | 2004-07-22 15:48:59 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-07-22 15:48:59 +0200 |
commit | bb587d719bbe170eacf0506f15565e926f5ffd7e (patch) | |
tree | f1bcf280a303ea3920c2ea0a4f7e9d54cb35ab3d | |
parent | 96998d6abce5465e93b6876804766e7f189b7621 (diff) | |
download | bugzilla-bb587d719bbe170eacf0506f15565e926f5ffd7e.tar.gz bugzilla-bb587d719bbe170eacf0506f15565e926f5ffd7e.tar.xz |
Bug 238544: Emit appropriate error if content and matches are used in
invalid search combinations.
r=jouni
a=justdave
-rw-r--r-- | Bugzilla/Search.pm | 6 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index bf81451ae..49f32fdf8 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -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"; }, diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index ed95724fb..503715ba2 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -691,6 +691,12 @@ [% 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 %] / |