Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
24f06218
Commit
24f06218
authored
Aug 15, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 162066 - Fix callers of ThrowCodeError to use messages in…
Bug 162066 - Fix callers of ThrowCodeError to use messages in code-error.html.tmpl. Patch by gerv; r=bbaetz.
parent
68424643
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
16 deletions
+29
-16
CGI.pl
CGI.pl
+8
-6
post_bug.cgi
post_bug.cgi
+3
-4
process_bug.cgi
process_bug.cgi
+3
-3
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+15
-3
No files found.
CGI.pl
View file @
24f06218
...
...
@@ -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
;
...
...
post_bug.cgi
View file @
24f06218
...
...
@@ -251,15 +251,14 @@ foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
if
(
$::FORM
{
$b
})
{
my
$v
=
substr
(
$b
,
4
);
$v
=~
/^(\d+)$/
||
ThrowCodeError
(
"One of the group bits submitted was invalid."
,
undef
,
"abort"
);
||
ThrowCodeError
(
"group_bit_invalid"
,
"abort"
);
if
(
!
GroupIsActive
(
$v
))
{
# Prevent the user from adding the bug to an inactive group.
# Should only happen if there is a bug in Bugzilla or the user
# hacked the "enter bug" form since otherwise the UI
# for adding the bug to the group won't appear on that form.
ThrowCodeError
(
"Attempted to add bug to an inactive group, "
.
"identified by the bit '$v'."
,
undef
,
"abort"
);
$vars
->
{
'bit'
}
=
$v
;
ThrowCodeError
(
"inactive_group"
,
"abort"
);
}
$sql
.=
" + $v"
;
# Carefully written so that the math is
# done by MySQL, which can handle 64-bit math,
...
...
process_bug.cgi
View file @
24f06218
...
...
@@ -805,9 +805,9 @@ SWITCH: for ($::FORM{'knob'}) {
last
SWITCH
;
};
# default
my
$escaped_knob
=
html_quote
(
$::FORM
{
'knob'
})
;
ThrowCodeError
(
"
Unknown action $escaped_knob!\
n"
);
$vars
->
{
'action'
}
=
$::FORM
{
'knob'
}
;
ThrowCodeError
(
"
unknown_actio
n"
);
}
...
...
template/en/default/global/code-error.html.tmpl
View file @
24f06218
...
...
@@ -42,13 +42,25 @@
to any [% parameters %] which you may have set before calling
ThrowCodeError.
[% ELSIF error == "another_error_tag" %]
This is another sample error, without a special title. This
should be the usual usage for this file. This sample can be removed.
[% ELSIF error == "group_bit_invalid" %]
One of the group bits submitted was invalid.
[% ELSIF error == "illegal_field" %]
A legal [% field FILTER html %] was not set.
[% ELSIF error == "inactive_group" %]
Attempted to add bug to an inactive group, identified by the bit
'[% bit FILTER html %]'.
[% ELSIF error == "template_error" %]
[% template_error_msg %]
[% ELSIF error == "undefined_field" %]
[% field FILTER html %] was not defined; [% Param('browserbugmessage') %]
[% ELSIF error == "unknown_action" %]
Unknown action [% action FILTER html %]!
[% ELSE %]
[%# Cope with legacy calling convention, where "error" was the string
# to print.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment