From: Imran Chaudhry Date: Fri, 27 Sep 2013 23:09:29 +0000 (+0200) Subject: Bug 798927: An error should be thrown when passing an illegal pronoun X-Git-Tag: bugzilla-4.5.1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e15329e9cf5c4a7a492b0a8689d436f012f45d;p=thirdparty%2Fbugzilla.git Bug 798927: An error should be thrown when passing an illegal pronoun r=LpSolit a=justdave --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index a7600f4494..7bd4381ed1 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -2196,7 +2196,8 @@ sub pronoun { if ($noun eq "%qacontact%") { return "COALESCE(bugs.qa_contact,0)"; } - return 0; + + ThrowUserError('illegal_pronoun', { pronoun => $noun }); } sub _contact_pronoun { diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 1a3aa07ac5..939eb2c3c8 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -891,6 +891,13 @@ Your group control combination for group " [% groupname FILTER html %]" is illegal. + [% ELSIF error == "illegal_pronoun" %] + [% title = "Illegal Pronoun" %] + The pronoun you used ([% pronoun FILTER html %]) is illegal. You must use + one of the approved pronouns. Please see + Pronoun Substitution + for a complete list. + [% ELSIF error == "illegal_query_name" %] [% title = "Illegal Search Name" %] The name of your search cannot contain any of the following characters: