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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e8584108
Commit
e8584108
authored
Aug 16, 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
de177c6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
Search.pm
Bugzilla/Search.pm
+9
-10
bug_form.pl
bug_form.pl
+2
-1
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+15
-5
No files found.
Bugzilla/Search.pm
View file @
e8584108
...
@@ -95,7 +95,7 @@ sub init {
...
@@ -95,7 +95,7 @@ sub init {
my
$c
=
&::
trim
(
$F
{
'votes'
});
my
$c
=
&::
trim
(
$F
{
'votes'
});
if
(
$c
ne
""
)
{
if
(
$c
ne
""
)
{
if
(
$c
!~
/^[0-9]*$/
)
{
if
(
$c
!~
/^[0-9]*$/
)
{
$vars
->
{
'value'
}
=
$c
;
$
::
vars
->
{
'value'
}
=
$c
;
&::
ThrowUserError
(
"illegal_at_least_x_votes"
);
&::
ThrowUserError
(
"illegal_at_least_x_votes"
);
}
}
push
(
@specialchart
,
[
"votes"
,
"greaterthan"
,
$c
-
1
]);
push
(
@specialchart
,
[
"votes"
,
"greaterthan"
,
$c
-
1
]);
...
@@ -179,7 +179,7 @@ sub init {
...
@@ -179,7 +179,7 @@ sub init {
if
(
@clist
)
{
if
(
@clist
)
{
push
(
@specialchart
,
\
@clist
);
push
(
@specialchart
,
\
@clist
);
}
else
{
}
else
{
$vars
->
{
'email'
}
=
$email
;
$
::
vars
->
{
'email'
}
=
$email
;
&::
ThrowUserError
(
"missing_email_type"
);
&::
ThrowUserError
(
"missing_email_type"
);
}
}
}
}
...
@@ -189,7 +189,7 @@ sub init {
...
@@ -189,7 +189,7 @@ sub init {
my
$c
=
&::
trim
(
$F
{
'changedin'
});
my
$c
=
&::
trim
(
$F
{
'changedin'
});
if
(
$c
ne
""
)
{
if
(
$c
ne
""
)
{
if
(
$c
!~
/^[0-9]*$/
)
{
if
(
$c
!~
/^[0-9]*$/
)
{
$vars
->
{
'value'
}
=
$c
;
$
::
vars
->
{
'value'
}
=
$c
;
&::
ThrowUserError
(
"illegal_changed_in_last_x_days"
);
&::
ThrowUserError
(
"illegal_changed_in_last_x_days"
);
}
}
push
(
@specialchart
,
[
"changedin"
,
push
(
@specialchart
,
[
"changedin"
,
...
@@ -437,7 +437,7 @@ sub init {
...
@@ -437,7 +437,7 @@ sub init {
push
(
@list
,
"$table.keywordid = $id"
);
push
(
@list
,
"$table.keywordid = $id"
);
}
}
else
{
else
{
$vars
->
{
'keyword'
}
=
$v
;
$
::
vars
->
{
'keyword'
}
=
$v
;
&::
ThrowUserError
(
"unknown_keyword"
);
&::
ThrowUserError
(
"unknown_keyword"
);
}
}
}
}
...
@@ -776,11 +776,10 @@ sub init {
...
@@ -776,11 +776,10 @@ sub init {
push
(
@orlist
,
$term
);
push
(
@orlist
,
$term
);
}
}
else
{
else
{
my
$errstr
=
# This field and this type don't work together.
qq|Cannot seem to handle <code>$F{"field$chart-$row-$col"}</code>
$::vars
->
{
'field'
}
=
$F
{
"field$chart-$row-$col"
};
and <code>$F{"type$chart-$row-$col"}</code> together|
;
$::vars
->
{
'type'
}
=
$F
{
"type$chart-$row-$col"
};
$chart
<
0
?
die
"Internal error: $errstr"
&::
ThrowCodeError
(
"field_type_mismatch"
);
:
&::
ThrowCodeError
(
$errstr
);
}
}
}
}
if
(
@orlist
)
{
if
(
@orlist
)
{
...
@@ -842,7 +841,7 @@ sub SqlifyDate {
...
@@ -842,7 +841,7 @@ sub SqlifyDate {
}
}
my
$date
=
str2time
(
$str
);
my
$date
=
str2time
(
$str
);
if
(
!
defined
(
$date
))
{
if
(
!
defined
(
$date
))
{
$vars
->
{
'date'
}
=
$str
;
$
::
vars
->
{
'date'
}
=
$str
;
ThrowUserError
(
"illegal_date"
);
ThrowUserError
(
"illegal_date"
);
}
}
return
time2str
(
"%Y-%m-%d %H:%M:%S"
,
$date
);
return
time2str
(
"%Y-%m-%d %H:%M:%S"
,
$date
);
...
...
bug_form.pl
View file @
e8584108
...
@@ -96,7 +96,8 @@ sub show_bug {
...
@@ -96,7 +96,8 @@ sub show_bug {
# The caller is meant to have checked this. Abort here so that
# The caller is meant to have checked this. Abort here so that
# we don't get obscure SQL errors, below
# we don't get obscure SQL errors, below
if
(
!
MoreSQLData
())
{
if
(
!
MoreSQLData
())
{
ThrowCodeError
(
"No data when fetching bug $id"
);
$vars
->
{
'bug_id'
}
=
$id
;
ThrowCodeError
(
"no_bug_data"
);
}
}
my
$value
;
my
$value
;
...
...
template/en/default/global/code-error.html.tmpl
View file @
e8584108
...
@@ -42,6 +42,10 @@
...
@@ -42,6 +42,10 @@
to any [% parameters %] which you may have set before calling
to any [% parameters %] which you may have set before calling
ThrowCodeError.
ThrowCodeError.
[% ELSIF error == "field_type_mismatch" %]
Cannot seem to handle <code>[% field %]</code>
and <code>[% type %]</code> together.
[% ELSIF error == "group_bit_invalid" %]
[% ELSIF error == "group_bit_invalid" %]
One of the group bits submitted was invalid.
One of the group bits submitted was invalid.
...
@@ -52,6 +56,9 @@
...
@@ -52,6 +56,9 @@
Attempted to add bug to an inactive group, identified by the bit
Attempted to add bug to an inactive group, identified by the bit
'[% bit FILTER html %]'.
'[% bit FILTER html %]'.
[% ELSIF error == "no_bug_data" %]
No data when fetching bug [% bug_id %].
[% ELSIF error == "template_error" %]
[% ELSIF error == "template_error" %]
[% template_error_msg %]
[% template_error_msg %]
...
@@ -62,11 +69,14 @@
...
@@ -62,11 +69,14 @@
Unknown action [% action FILTER html %]!
Unknown action [% action FILTER html %]!
[% ELSE %]
[% ELSE %]
[%# Cope with legacy calling convention, where "error" was the string
[%# Give sensible error if error functions are used incorrectly.
# to print.
#%]
#%]
You are using Bugzilla's ThrowCodeError() function incorrectly. You
passed in the string '[% message_tag %]'. The correct use is to pass
[% error %]
in a tag, and define that tag in the file code-error.html.tmpl.<br>
<br>
If you are a Bugzilla end-user seeing this message, please save this
page and send it to [% Param('maintainer') %].
[% END %]
[% END %]
[% END %]
[% END %]
...
...
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