From: Sunil Joshi Date: Tue, 1 Jan 2013 23:22:58 +0000 (+0100) Subject: Bug 401918: describekeywords.cgi with no keywords simply displays an empty page inste... X-Git-Tag: bugzilla-4.5.1~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59460995ee7a5634fdd27765b75e79053eb43c1a;p=thirdparty%2Fbugzilla.git Bug 401918: describekeywords.cgi with no keywords simply displays an empty page instead of throwing an error r/a=LpSolit --- diff --git a/describekeywords.cgi b/describekeywords.cgi index ef06349602..4976fada1c 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -24,6 +24,9 @@ my $vars = {}; Bugzilla->switch_to_shadow_db; $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count(); +if (!@{$vars->{keywords}}) { + ThrowUserError("no_keywords"); +} $vars->{'caneditkeywords'} = $user->in_group("editkeywords"); print $cgi->header(); diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index ce80a5eef4..03c26c5aac 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1282,6 +1282,11 @@ [% title = "No Initial $terms.Bug Status" %] No [% terms.bug %] status is available on [% terms.bug %] creation. Please report the problem to [% Param("maintainer") %]. + + [% ELSIF error == "no_keywords" %] + [% title = "No Keywords" %] + [% admindocslinks = {'keywords.html' => 'Setting up a keyword'} %] + No keywords have been defined for this installation. [% ELSIF error == "no_new_quips" %] [% title = "No New Quips" %]