From: bugreport%peshkin.net <> Date: Thu, 22 Jul 2004 13:57:09 +0000 (+0000) Subject: Bug 238544: Emit appropriate error if content and matches are used in X-Git-Tag: bugzilla-2.18rc2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=320a7c6ae6b302649d9a067c04817037237be621;p=thirdparty%2Fbugzilla.git Bug 238544: Emit appropriate error if content and matches are used in invalid search combinations. r=jouni a=justdave --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 04a0004fe0..683c2e0573 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -450,6 +450,9 @@ sub init { push(@fields, $select_term); } }, + "^content," => sub { + ThrowUserError("search_content_without_matches"); + }, "^commenter," => sub { my $chartseq; my $list; @@ -784,6 +787,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 5ff7fedec4..af99313f03 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -654,6 +654,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 [% series.category FILTER html %] /