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
02ce78bf
Commit
02ce78bf
authored
Sep 05, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 166698 - clean up the error system, which was confused and broken. Patch by gerv; r=bbaetz.
parent
7fb4c30e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
199 deletions
+184
-199
CGI.pl
CGI.pl
+0
-4
page.cgi
page.cgi
+2
-6
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+2
-4
messages.html.tmpl
template/en/default/global/messages.html.tmpl
+5
-181
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+175
-4
No files found.
CGI.pl
View file @
02ce78bf
...
@@ -861,10 +861,6 @@ sub ThrowCodeError {
...
@@ -861,10 +861,6 @@ sub ThrowCodeError {
}
}
# For errors made by the user.
# For errors made by the user.
# The correct use of this function is to pass an error tag, defined in
# user-error.html.tmpl, as the first parameter, and then, optionally,
# undef as the second parameter and $unlock_tables as the third.
# The second parameter will eventually go away.
sub
ThrowUserError
{
sub
ThrowUserError
{
(
$vars
->
{
'error'
},
my
$unlock_tables
)
=
(
@_
);
(
$vars
->
{
'error'
},
my
$unlock_tables
)
=
(
@_
);
...
...
page.cgi
View file @
02ce78bf
...
@@ -39,19 +39,15 @@ ConnectToDatabase();
...
@@ -39,19 +39,15 @@ ConnectToDatabase();
quietly_check_login
();
quietly_check_login
();
print
"Content-Type: text/html\n\n"
;
if
(
defined
$::FORM
{
'id'
})
{
if
(
defined
$::FORM
{
'id'
})
{
$::FORM
{
'id'
}
=~
s/[^\w-]//g
;
$::FORM
{
'id'
}
=~
s/[^\w-]//g
;
if
(
$pages
{
$::FORM
{
'id'
}})
{
if
(
$pages
{
$::FORM
{
'id'
}})
{
print
"Content-Type: text/html\n\n"
;
$template
->
process
(
$pages
{
$::FORM
{
'id'
}},
$vars
)
$template
->
process
(
$pages
{
$::FORM
{
'id'
}},
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
||
ThrowTemplateError
(
$template
->
error
());
exit
;
exit
;
}
}
}
}
$vars
->
{
'message'
}
=
"page_not_found"
;
ThrowUserError
(
"page_not_found"
);
$template
->
process
(
"global/message.html.tmpl"
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
template/en/default/global/code-error.html.tmpl
View file @
02ce78bf
...
@@ -21,9 +21,7 @@
...
@@ -21,9 +21,7 @@
[%# INTERFACE:
[%# INTERFACE:
# header_done: boolean. True if the header has already been printed.
# header_done: boolean. True if the header has already been printed.
# error: string. The tag of the error, or the error message to be displayed
# error: string. The tag of the error.
# (deprecated). May contain HTML if it's an error message.
# title: string. If error is an error message, the title (deprecated.)
# variables: hash. Useful data about the problem. The keys are the variable
# variables: hash. Useful data about the problem. The keys are the variable
# names, and the values the variable values.
# names, and the values the variable values.
#%]
#%]
...
@@ -72,7 +70,7 @@
...
@@ -72,7 +70,7 @@
[%# Give sensible error if error functions are used incorrectly.
[%# Give sensible error if error functions are used incorrectly.
#%]
#%]
You are using Bugzilla's ThrowCodeError() function incorrectly. You
You are using Bugzilla's ThrowCodeError() function incorrectly. You
passed in the string '[%
message_tag
%]'. The correct use is to pass
passed in the string '[%
error
%]'. The correct use is to pass
in a tag, and define that tag in the file code-error.html.tmpl.<br>
in a tag, and define that tag in the file code-error.html.tmpl.<br>
<br>
<br>
If you are a Bugzilla end-user seeing this message, please save this
If you are a Bugzilla end-user seeing this message, please save this
...
...
template/en/default/global/messages.html.tmpl
View file @
02ce78bf
...
@@ -45,13 +45,7 @@
...
@@ -45,13 +45,7 @@
also bookmark the result of any individual query.
also bookmark the result of any individual query.
[% ELSIF message_tag == "buglist_new_named_query" %]
[% ELSIF message_tag == "buglist_new_named_query" %]
OK, you have a new query named <code>[% queryname FILTER html %]</code>."
OK, you have a new query named <code>[% queryname FILTER html %]</code>.
[% ELSIF message_tag == "buglist_parameters_required" %]
[% title = "Parameters Required" %]
[% url = "query.cgi" %]
[% link = "Please use the search form to specify some search criteria." %]
This script is not meant to be invoked without any search terms.
[% ELSIF message_tag == "buglist_query_gone" %]
[% ELSIF message_tag == "buglist_query_gone" %]
[% title = "Query is gone" %]
[% title = "Query is gone" %]
...
@@ -62,122 +56,6 @@
...
@@ -62,122 +56,6 @@
[% title = "Change columns" %]
[% title = "Change columns" %]
Resubmitting your query with new columns...
Resubmitting your query with new columns...
[% ELSIF message_tag == "account_disabled" %]
[% title = "Account Disabled" %]
[% disabledreason %]
<hr>
If you believe your account should be restored, please
send email to [% Param("maintainer") %] explaining why.
[% ELSIF message_tag == "account_exists" %]
[% title = "Account Already Exists" %]
That account already exists.
[% ELSIF message_tag == "alias_has_comma_or_space" %]
[% title = "Invalid Characters In Alias" %]
The alias you entered, <em>[% alias FILTER html %]</em>,
contains one or more commas or spaces. Aliases cannot contain
commas or spaces because those characters are used to separate
aliases from each other in lists. Please choose another alias
that does not contain commas and spaces.
[% ELSIF message_tag == "alias_in_use" %]
[% title = "Alias In Use" %]
[% bug_link %] has already taken the alias
<em>[% alias FILTER html %]</em>. Please choose another one.
[% ELSIF message_tag == "alias_is_numeric" %]
[% title = "Alias Is Numeric" %]
You tried to give this bug the alias <em>[% alias FILTER html %]</em>,
but aliases cannot be merely numbers, since they could
then be confused with bug IDs. Please choose another
alias containing at least one letter.
[% ELSIF message_tag == "alias_too_long" %]
[% title = "Alias Too Long" %]
Bug aliases cannot be longer than 20 characters.
Please choose a shorter alias.
[% ELSIF message_tag == "bugs_not_changed" %]
[% title = "Bugs Not Changed" %]
Um, you apparently did not change anything on the selected bugs.
[% ELSIF message_tag == "comment_required" %]
[% title = "Comment Required" %]
You have to specify a <b>comment</b> on this change.
Please give some words on the reason for your change.
[% ELSIF message_tag == "dependency_loop_multi" %]
[% title = "Dependency Loop Detected" %]
The following bug(s) would appear on both the "depends on"
and "blocks" parts of the dependency tree if these changes
are committed: [% both %]. This would create a circular
dependency, which is not allowed.
[% ELSIF message_tag == "dependency_loop_single" %]
[% title = "Dependency Loop Detected" %]
You can't make a bug blocked or dependent on itself.
[% ELSIF message_tag == "dupe_invalid_bug_id" %]
[% title = "Valid Bug Number Required" %]
You must specify a valid bug number of which this bug
is a duplicate. The bug has not been changed.
[% ELSIF message_tag == "dupe_of_self_disallowed" %]
[% title = "Nice Try..." %]
Nice try, [% user.login FILTER html %], but it doesn't
really make sense to mark a bug as a duplicate of itself,
does it?
[% ELSIF message_tag == "illegal_at_least_x_votes" %]
[% title = "Your Query Makes No Sense" %]
The <em>At least ___ votes</em> field must be a simple number.
You entered <tt>[% value FILTER html %]</tt>, which isn't.
[% ELSIF message_tag == "illegal_attachment_is_patch" %]
[% title = "Your Query Makes No Sense" %]
The only legal values for the <em>Attachment is patch</em> field are
0 and 1.
[% ELSIF message_tag == "illegal_change" %]
You tried to change the <strong>[% field %]</strong> field
from <em>[% oldvalue FILTER html %]</em> to
<em>[% newvalue FILTER html %]</em>,
but only the owner or submitter of the bug, or a
sufficiently empowered user, may change that field.
[% ELSIF message_tag == "illegal_changed_in_last_x_days" %]
[% title = "Your Query Makes No Sense" %]
The <em>Changed in last ___ days</em> field must be a simple number.
You entered <tt>[% value FILTER html %]</tt>, which isn't.
[% ELSIF message_tag == "illegal_date" %]
[% title = "Your Query Makes No Sense" %]
'<tt>[% date %]</tt>' is not a legal date.
[% ELSIF message_tag == "illegal_is_obsolete" %]
[% title = "Your Query Makes No Sense" %]
The only legal values for the <em>Attachment is obsolete</em> field are
0 and 1.
[% ELSIF message_tag == "invalid_bug_id" %]
[% title = "Invalid Bug ID" %]
The bug id [% bug_id FILTER html %] is invalid.
[% ELSIF message_tag == "invalid_email_address" %]
[% title = "Invalid Email Address" %]
The e-mail address you entered(<b>[% addr FILTER html %]</b>)
didn't pass our syntax checking for a legal email address.
[% Param('emailregexpdesc') %]
It must also not contain any of these special characters:
<tt>\ ( ) & < > , ; : " [ ]</tt>, or any whitespace.
[% ELSIF message_tag == "invalid_username" %]
[% title = "Invalid Username" %]
The name <tt>[% name FILTER html %]</tt> is not a valid username.
Either you misspelled it, or the person has not
registered for a Bugzilla account.
[% ELSIF message_tag == "logged_out" %]
[% ELSIF message_tag == "logged_out" %]
[% title = "Logged Out" %]
[% title = "Logged Out" %]
[% url = "query.cgi?GoAheadAndLogIn=1" %]
[% url = "query.cgi?GoAheadAndLogIn=1" %]
...
@@ -190,53 +68,6 @@
...
@@ -190,53 +68,6 @@
[% title = "Bugzilla Login Changed" %]
[% title = "Bugzilla Login Changed" %]
Your Bugzilla login has been changed.
Your Bugzilla login has been changed.
[% ELSIF message_tag == "page_not_found" %]
[% title = "Page not found" %]
The page you requested cannot be found.
[% ELSIF message_tag == "milestone_required" %]
[% title = "Milestone Required" %]
You must determine a target milestone for bug [% bug_id %]
if you are going to accept it. Part of accepting
a bug is giving an estimate of when it will be fixed.
[% ELSIF message_tag == "missing_email_type" %]
[% title = "Your Query Makes No Sense" %]
You must specify one or more fields in which to search for
<tt>[% email %]</tt>.
[% ELSIF message_tag == "need_component" %]
[% title = "Component Required" %]
You must specify a component to help determine the new owner of these bugs.
[% ELSIF message_tag == "need_product" %]
[% title = "Product Required" %]
You must specify a product to help determine the new owner of these bugs.
[% ELSIF message_tag == "no_bugs_chosen" %]
[% title = "No Bugs Chosen" %]
You apparently didn't choose any bugs to modify.
[% ELSIF message_tag == "no_dupe_stats" %]
[% title = "Cannot Find Duplicate Statistics" %]
There are no duplicate statistics for today ([% today %]) or yesterday.
[% ELSIF message_tag == "no_dupe_stats_error_today" %]
[% title = "Error Reading Today's Dupes File" %]
An error occurred opening today's dupes file: [% error_msg FILTER html %].
[% ELSIF message_tag == "no_dupe_stats_error_whenever" %]
[% title = "Error Reading Previous Dupes File" %]
An error occurred opening $changedsince days ago ($whenever)'s dupes file:
[% error_msg FILTER html %].
[% ELSIF message_tag == "no_dupe_stats_error_yesterday" %]
[% title = "Error Reading Yesterday's Dupes File" %]
There are no duplicate statistics for today ([% today %]), and an error
occurred opening yesterday's dupes file: [% error_msg FILTER html %].
[% ELSIF message_tag == "password_changed" %]
[% title = "Password Changed" %]
Your password has been changed.
[% ELSIF message_tag == "password_change_canceled" %]
[% ELSIF message_tag == "password_change_canceled" %]
[% title = "Cancel Request to Change Password" %]
[% title = "Cancel Request to Change Password" %]
Your request has been cancelled.
Your request has been cancelled.
...
@@ -246,25 +77,18 @@
...
@@ -246,25 +77,18 @@
A token for changing your password has been emailed to you.
A token for changing your password has been emailed to you.
Follow the instructions in that email to change your password.
Follow the instructions in that email to change your password.
[% ELSIF message_tag == "reassign_to_empty" %]
[% ELSIF message_tag == "password_changed" %]
[% title = "Illegal Reassignment" %]
[% title = "Password Changed" %]
You cannot reassign to a bug to nobody. Unless you
Your password has been changed.
intentionally cleared out the "Reassign bug to"
field, [% Param("browserbugmessage") %]
[% ELSIF message_tag == "shutdown" %]
[% ELSIF message_tag == "shutdown" %]
[% title = "Bugzilla is Down" %]
[% title = "Bugzilla is Down" %]
[% Param("shutdownhtml") %]
[% Param("shutdownhtml") %]
[% ELSIF message_tag == "unknown_keyword" %]
[% title = "Unknown Keyword" %]
<code>[% keyword FILTER html %]</code> is not a known keyword.
The legal keyword names are <a href="describekeywords.cgi">listed here</a>.
[% ELSE %]
[% ELSE %]
[%# Give sensible error if error functions are used incorrectly.
[%# Give sensible error if error functions are used incorrectly.
#%]
#%]
You are using Bugzilla's
error-report
ing functions incorrectly. You
You are using Bugzilla's
messag
ing functions incorrectly. You
passed in the string '[% message_tag %]'. The correct use is to pass
passed in the string '[% message_tag %]'. The correct use is to pass
in a tag, and define that tag in the file messages.html.tmpl.<br>
in a tag, and define that tag in the file messages.html.tmpl.<br>
<br>
<br>
...
...
template/en/default/global/user-error.html.tmpl
View file @
02ce78bf
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
# header_done: boolean. True if the header has already been printed.
# header_done: boolean. True if the header has already been printed.
# error: string. The tag of the error, or the error message to be displayed
# error: string. The tag of the error, or the error message to be displayed
# (deprecated). May contain HTML if it's an error message.
# (deprecated). May contain HTML if it's an error message.
# title: string. If error is an error message, the title (deprecated.)
#%]
#%]
[%# This is a list of all the possible user errors. Please keep them in
[%# This is a list of all the possible user errors. Please keep them in
...
@@ -40,9 +39,181 @@
...
@@ -40,9 +39,181 @@
to any [% parameters %] which you may have set before calling
to any [% parameters %] which you may have set before calling
ThrowUserError.
ThrowUserError.
[% ELSIF error == "another_error_tag" %]
[% ELSIF error == "account_disabled" %]
[% title = "Another Error" %]
[% title = "Account Disabled" %]
This is another sample error. It can be removed.
[% disabledreason %]
<hr>
If you believe your account should be restored, please
send email to [% Param("maintainer") %] explaining why.
[% ELSIF error == "account_exists" %]
[% title = "Account Already Exists" %]
That account already exists.
[% ELSIF error == "alias_has_comma_or_space" %]
[% title = "Invalid Characters In Alias" %]
The alias you entered, <em>[% alias FILTER html %]</em>,
contains one or more commas or spaces. Aliases cannot contain
commas or spaces because those characters are used to separate
aliases from each other in lists. Please choose another alias
that does not contain commas and spaces.
[% ELSIF error == "alias_in_use" %]
[% title = "Alias In Use" %]
[% bug_link %] has already taken the alias
<em>[% alias FILTER html %]</em>. Please choose another one.
[% ELSIF error == "alias_is_numeric" %]
[% title = "Alias Is Numeric" %]
You tried to give this bug the alias <em>[% alias FILTER html %]</em>,
but aliases cannot be merely numbers, since they could
then be confused with bug IDs. Please choose another
alias containing at least one letter.
[% ELSIF error == "alias_too_long" %]
[% title = "Alias Too Long" %]
Bug aliases cannot be longer than 20 characters.
Please choose a shorter alias.
[% ELSIF error == "buglist_parameters_required" %]
[% title = "Parameters Required" %]
[% url = "query.cgi" %]
[% link = "Please use the search form to specify some search criteria." %]
This script is not meant to be invoked without any search terms.
[% ELSIF error == "bugs_not_changed" %]
[% title = "Bugs Not Changed" %]
Um, you apparently did not change anything on the selected bugs.
[% ELSIF error == "comment_required" %]
[% title = "Comment Required" %]
You have to specify a <b>comment</b> on this change.
Please give some words on the reason for your change.
[% ELSIF error == "dependency_loop_multi" %]
[% title = "Dependency Loop Detected" %]
The following bug(s) would appear on both the "depends on"
and "blocks" parts of the dependency tree if these changes
are committed: [% both %]. This would create a circular
dependency, which is not allowed.
[% ELSIF error == "dependency_loop_single" %]
[% title = "Dependency Loop Detected" %]
You can't make a bug blocked or dependent on itself.
[% ELSIF error == "dupe_invalid_bug_id" %]
[% title = "Valid Bug Number Required" %]
You must specify a valid bug number of which this bug
is a duplicate. The bug has not been changed.
[% ELSIF error == "dupe_of_self_disallowed" %]
[% title = "Nice Try..." %]
Nice try, [% user.login FILTER html %], but it doesn't
really make sense to mark a bug as a duplicate of itself,
does it?
[% ELSIF error == "illegal_at_least_x_votes" %]
[% title = "Your Query Makes No Sense" %]
The <em>At least ___ votes</em> field must be a simple number.
You entered <tt>[% value FILTER html %]</tt>, which isn't.
[% ELSIF error == "illegal_attachment_is_patch" %]
[% title = "Your Query Makes No Sense" %]
The only legal values for the <em>Attachment is patch</em> field are
0 and 1.
[% ELSIF error == "illegal_change" %]
You tried to change the <strong>[% field %]</strong> field
from <em>[% oldvalue FILTER html %]</em> to
<em>[% newvalue FILTER html %]</em>,
but only the owner or submitter of the bug, or a
sufficiently empowered user, may change that field.
[% ELSIF error == "illegal_changed_in_last_x_days" %]
[% title = "Your Query Makes No Sense" %]
The <em>Changed in last ___ days</em> field must be a simple number.
You entered <tt>[% value FILTER html %]</tt>, which isn't.
[% ELSIF error == "illegal_date" %]
[% title = "Your Query Makes No Sense" %]
'<tt>[% date %]</tt>' is not a legal date.
[% ELSIF error == "illegal_email_address" %]
[% title = "Invalid Email Address" %]
The e-mail address you entered(<b>[% addr FILTER html %]</b>)
didn't pass our syntax checking for a legal email address.
[% Param('emailregexpdesc') %]
It must also not contain any of these special characters:
<tt>\ ( ) & < > , ; : " [ ]</tt>, or any whitespace.
[% ELSIF error == "illegal_is_obsolete" %]
[% title = "Your Query Makes No Sense" %]
The only legal values for the <em>Attachment is obsolete</em> field are
0 and 1.
[% ELSIF error == "invalid_bug_id" %]
[% title = "Invalid Bug ID" %]
The bug id [% bug_id FILTER html %] is invalid.
[% ELSIF error == "invalid_username" %]
[% title = "Invalid Username" %]
The name <tt>[% name FILTER html %]</tt> is not a valid username.
Either you misspelled it, or the person has not
registered for a Bugzilla account.
[% ELSIF error == "milestone_required" %]
[% title = "Milestone Required" %]
You must determine a target milestone for bug [% bug_id %]
if you are going to accept it. Part of accepting
a bug is giving an estimate of when it will be fixed.
[% ELSIF error == "missing_email_type" %]
[% title = "Your Query Makes No Sense" %]
You must specify one or more fields in which to search for
<tt>[% email %]</tt>.
[% ELSIF error == "need_component" %]
[% title = "Component Required" %]
You must specify a component to help determine the new owner of these bugs.
[% ELSIF error == "need_product" %]
[% title = "Product Required" %]
You must specify a product to help determine the new owner of these bugs.
[% ELSIF error == "no_bugs_chosen" %]
[% title = "No Bugs Chosen" %]
You apparently didn't choose any bugs to modify.
[% ELSIF error == "no_dupe_stats" %]
[% title = "Cannot Find Duplicate Statistics" %]
There are no duplicate statistics for today ([% today %]) or yesterday.
[% ELSIF error == "no_dupe_stats_error_today" %]
[% title = "Error Reading Today's Dupes File" %]
An error occurred opening today's dupes file: [% error_msg FILTER html %].
[% ELSIF error == "no_dupe_stats_error_whenever" %]
[% title = "Error Reading Previous Dupes File" %]
An error occurred opening $changedsince days ago ($whenever)'s dupes file:
[% error_msg FILTER html %].
[% ELSIF error == "no_dupe_stats_error_yesterday" %]
[% title = "Error Reading Yesterday's Dupes File" %]
There are no duplicate statistics for today ([% today %]), and an error
occurred opening yesterday's dupes file: [% error_msg FILTER html %].
[% ELSIF error == "page_not_found" %]
[% title = "Page not found" %]
The page you requested cannot be found.
[% ELSIF error == "reassign_to_empty" %]
[% title = "Illegal Reassignment" %]
You cannot reassign to a bug to nobody. Unless you
intentionally cleared out the "Reassign bug to"
field, [% Param("browserbugmessage") %]
[% ELSIF error == "unknown_keyword" %]
[% title = "Unknown Keyword" %]
<code>[% keyword FILTER html %]</code> is not a known keyword.
The legal keyword names are <a href="describekeywords.cgi">listed here</a>.
[% ELSE %]
[% ELSE %]
[%# Cope with legacy calling convention, where "error" was the string
[%# Cope with legacy calling convention, where "error" was the string
...
...
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