summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-04-26 15:13:40 +0200
committergerv%gerv.net <>2002-04-26 15:13:40 +0200
commit3321a21580047a12832f47e16220c2c3ee0c7d1b (patch)
treedb91149b1a1d43b2e2e082aa4d03a701125d3b90 /CGI.pl
parentb236802ccb76b57369aa650bf45aba8dbf9d3ac9 (diff)
downloadbugzilla-3321a21580047a12832f47e16220c2c3ee0c7d1b.tar.gz
bugzilla-3321a21580047a12832f47e16220c2c3ee0c7d1b.tar.xz
Bug 140124 - PuntTryAgain must die. Patch by gerv, 2xr=myk.
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl23
1 files changed, 5 insertions, 18 deletions
diff --git a/CGI.pl b/CGI.pl
index f9892f7c6..c0e38c50a 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -228,14 +228,11 @@ sub CheckFormField (\%$;\@) {
SendSQL("SELECT description FROM fielddefs WHERE name=" . SqlQuote($fieldname));
my $result = FetchOneColumn();
if ($result) {
- PuntTryAgain("A legal $result was not set.");
+ ThrowCodeError("A legal $result was not set.", undef, "abort");
}
else {
- PuntTryAgain("A legal $fieldname was not set.");
- print Param("browserbugmessage");
+ ThrowCodeError("A legal $fieldname was not set.", undef, "abort");
}
- PutFooter();
- exit 0;
}
}
@@ -965,9 +962,11 @@ 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'}) = (@_);
+ ($vars->{'error'}, $vars->{'variables'}, my $unlock_tables) = (@_);
$vars->{'title'} = "Code Error";
+ SendSQL("UNLOCK TABLES") if $unlock_tables;
+
# We may optionally log something to file here.
print "Content-type: text/html\n\n" if !$vars->{'header_done'};
@@ -1016,18 +1015,6 @@ END
exit;
}
-# PuntTryAgain is deprecated. Use UserError with the unlock_tables parameter.
-sub PuntTryAgain ($) {
- ($vars->{'error'}) = (@_);
-
- SendSQL("UNLOCK TABLES");
-
- $vars->{'header_done'} = "true";
- $template->process("global/user-error.html.tmpl", $vars)
- || ThrowTemplateError($template->error());
- exit;
-}
-
sub CheckIfVotedConfirmed {
my ($id, $who) = (@_);
SendSQL("SELECT bugs.votes, bugs.bug_status, products.votestoconfirm, " .