From 19efc5771e076d730b4bccf8f267ffc1de924062 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Wed, 15 Oct 2003 22:48:12 +0000 Subject: [PATCH] Bug 108528 - knob is not defined doesn't explain to 2001110503 users what to do patch by caduvall@glue.umd.edu r=timeless a=justdave --- webtools/bugzilla/CGI.pl | 3 ++- webtools/bugzilla/process_bug.cgi | 2 +- .../template/en/default/global/code-error.html.tmpl | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/webtools/bugzilla/CGI.pl b/webtools/bugzilla/CGI.pl index bcd9a7f90042..06db6fe554cb 100644 --- a/webtools/bugzilla/CGI.pl +++ b/webtools/bugzilla/CGI.pl @@ -111,10 +111,11 @@ sub CheckFormField (\%$;\@) { sub CheckFormFieldDefined (\%$) { my ($formRef, # a reference to the form to check (a hash) $fieldname, # the fieldname to check + $info, # (optional) error message to give ) = @_; if (!defined $formRef->{$fieldname}) { - ThrowCodeError("undefined_field", { field => $fieldname }); + ThrowCodeError("undefined_field", { field => $fieldname, info => $info }); } } diff --git a/webtools/bugzilla/process_bug.cgi b/webtools/bugzilla/process_bug.cgi index e504fd7ea9f3..d3155af3364a 100755 --- a/webtools/bugzilla/process_bug.cgi +++ b/webtools/bugzilla/process_bug.cgi @@ -858,7 +858,7 @@ if (defined $::FORM{newcc} || defined $::FORM{removecc} || defined $::FORM{massc } -CheckFormFieldDefined(\%::FORM, 'knob'); +CheckFormFieldDefined(\%::FORM, 'knob', "check that \"Leave as...\" was selected."); SWITCH: for ($::FORM{'knob'}) { /^none$/ && do { last SWITCH; diff --git a/webtools/bugzilla/template/en/default/global/code-error.html.tmpl b/webtools/bugzilla/template/en/default/global/code-error.html.tmpl index 73501672b9bb..458f55c559a3 100644 --- a/webtools/bugzilla/template/en/default/global/code-error.html.tmpl +++ b/webtools/bugzilla/template/en/default/global/code-error.html.tmpl @@ -208,7 +208,12 @@ I was unable to retrieve your old password from the database. [% ELSIF error == "undefined_field" %] - [% field FILTER html %] was not defined; [% Param('browserbugmessage') %] + [% field FILTER html %] was not defined; + [% IF info %] + [% info FILTER html %] + [% ELSE %] + [% Param('browserbugmessage') %] + [% END %] [% ELSIF error == "unknown_action" %] [% IF action %]