From 418761147e7d8563487f70280852d7b73c378b51 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" Date: Thu, 22 Jul 2004 06:48:59 +0000 Subject: [PATCH] Bug 238544: Emit appropriate error if content and matches are used in invalid search combinations. r=jouni a=justdave git-svn-id: svn://10.0.0.236/trunk@159636 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/Search.pm | 6 ++++++ .../template/en/default/global/user-error.html.tmpl | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search.pm b/mozilla/webtools/bugzilla/Bugzilla/Search.pm index bf81451aec8..49f32fdf8fb 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search.pm +++ b/mozilla/webtools/bugzilla/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/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl index ed95724fb34..503715ba226 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl +++ b/mozilla/webtools/bugzilla/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 [% series.category FILTER html %] /