summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-08-15 15:43:44 +0200
committergerv%gerv.net <>2002-08-15 15:43:44 +0200
commit24f062186a9b6dcdcefa79c12ae82b95243c7e41 (patch)
tree2f3234eebadd94b40fcfc837e4b42ea3341db219 /CGI.pl
parent684246432c854ffab436304470545f1da46eae07 (diff)
downloadbugzilla-24f062186a9b6dcdcefa79c12ae82b95243c7e41.tar.gz
bugzilla-24f062186a9b6dcdcefa79c12ae82b95243c7e41.tar.xz
Bug 162066 - Fix callers of ThrowCodeError to use messages in code-error.html.tmpl. Patch by gerv; r=bbaetz.
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/CGI.pl b/CGI.pl
index de2d38085..d16a94883 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -218,11 +218,13 @@ sub CheckFormField (\%$;\@) {
SendSQL("SELECT description FROM fielddefs WHERE name=" . SqlQuote($fieldname));
my $result = FetchOneColumn();
if ($result) {
- ThrowCodeError("A legal $result was not set.", undef, "abort");
+ $vars->{'field'} = $result;
}
else {
- ThrowCodeError("A legal $fieldname was not set.", undef, "abort");
+ $vars->{'field'} = $fieldname;
}
+
+ ThrowCodeError("illegal_field", "abort");
}
}
@@ -233,9 +235,9 @@ sub CheckFormFieldDefined (\%$) {
) = @_;
if (!defined $formRef->{$fieldname}) {
- ThrowCodeError("$fieldname was not defined; " .
- Param("browserbugmessage"));
- }
+ $vars->{'field'} = $fieldname;
+ ThrowCodeError("undefined_field");
+ }
}
sub BugAliasToID {
@@ -876,7 +878,7 @@ sub DisplayError {
# For "this shouldn't happen"-type places in the code.
# $vars->{'variables'} is a reference to a hash of useful debugging info.
sub ThrowCodeError {
- ($vars->{'error'}, $vars->{'variables'}, my $unlock_tables) = (@_);
+ ($vars->{'error'}, my $unlock_tables, $vars->{'variables'}) = (@_);
SendSQL("UNLOCK TABLES") if $unlock_tables;