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
618851e7
Commit
618851e7
authored
Sep 13, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 167978 - Fix Throw*Error l10n regressions and add a test to catch more.…
Bug 167978 - Fix Throw*Error l10n regressions and add a test to catch more. Patch by gerv; r=bbaetz.
parent
c5d6844e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
12 deletions
+60
-12
attachment.cgi
attachment.cgi
+1
-1
describecomponents.cgi
describecomponents.cgi
+4
-1
duplicates.cgi
duplicates.cgi
+2
-2
post_bug.cgi
post_bug.cgi
+2
-2
process_bug.cgi
process_bug.cgi
+1
-2
quips.cgi
quips.cgi
+1
-1
002goodperl.t
t/002goodperl.t
+27
-1
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+21
-0
userprefs.cgi
userprefs.cgi
+1
-2
No files found.
attachment.cgi
View file @
618851e7
...
...
@@ -142,7 +142,7 @@ sub validateID
my
(
$bugid
,
$isprivate
)
=
FetchSQLData
();
ValidateBugID
(
$bugid
);
if
((
$isprivate
>
0
)
&&
Param
(
"insidergroup"
)
&&
!
(
UserInGroup
(
Param
(
"insidergroup"
))))
{
ThrowUserError
(
"
You are not permitted access to this attachment.
"
);
ThrowUserError
(
"
attachment_access_denied
"
);
}
}
...
...
describecomponents.cgi
View file @
618851e7
...
...
@@ -87,7 +87,10 @@ my $product = $::FORM{'product'};
# cannot get any other information about that product.
my
$product_id
=
get_product_id
(
$product
);
ThrowUserError
(
"The product name is invalid."
)
unless
$product_id
;
if
(
!
$product_id
)
{
$::vars
->
{
'product'
}
=
$product
;
ThrowUserError
(
"invalid_product_name"
);
}
# Make sure the user is authorized to access this product.
if
(
Param
(
"usebuggroups"
)
&&
GroupExists
(
$product
))
{
...
...
duplicates.cgi
View file @
618851e7
...
...
@@ -65,8 +65,8 @@ my $product_id;
if
(
$product
)
{
$product_id
=
get_product_id
(
$product
);
if
(
!
$product_id
)
{
ThrowUserError
(
"The product <tt>"
.
html_quote
(
$product
)
.
"</tt> does not exist
"
);
$vars
->
{
'product'
}
=
$product
;
ThrowUserError
(
"invalid_product_name
"
);
}
}
...
...
post_bug.cgi
View file @
618851e7
...
...
@@ -71,8 +71,8 @@ ValidateComment($comment);
my
$product
=
$::FORM
{
'product'
};
my
$product_id
=
get_product_id
(
$product
);
if
(
!
$product_id
)
{
ThrowUserError
(
"Sorry, the product <tt>"
.
html_quote
(
$product
)
.
"</tt> does not exist
"
);
$vars
->
{
'product'
}
=
$product
;
ThrowUserError
(
"invalid_product_name
"
);
}
# Set cookies
...
...
process_bug.cgi
View file @
618851e7
...
...
@@ -558,8 +558,7 @@ if ($::FORM{'product'} ne $::dontchange) {
my
$comp_id
;
# Remember, can't use this for mass changes
if
(
$::FORM
{
'component'
}
ne
$::dontchange
)
{
if
(
!
defined
$prod_id
)
{
ThrowUserError
(
"You cannot change the component from a list of bugs "
.
"covering more than one product"
);
ThrowUserError
(
"no_component_change_for_multiple_products"
);
}
$comp_id
=
get_component_id
(
$prod_id
,
$::FORM
{
'component'
});
...
...
quips.cgi
View file @
618851e7
...
...
@@ -63,7 +63,7 @@ if ($action eq "add") {
}
if
(
Param
(
'enablequips'
)
ne
"on"
)
{
ThrowUserError
(
"
This site does not permit the addition of new
quips"
);
ThrowUserError
(
"
no_new_
quips"
);
exit
();
}
...
...
t/002goodperl.t
View file @
618851e7
...
...
@@ -44,7 +44,7 @@ use lib 't';
use
Support::
Files
;
use
Test::
More
tests
=>
(
scalar
(
@
Support::Files::
testitems
)
*
2
);
use
Test::
More
tests
=>
(
scalar
(
@
Support::Files::
testitems
)
*
3
);
my
@testitems
=
@
Support::Files::
testitems
;
# get the files to test.
...
...
@@ -116,4 +116,30 @@ foreach my $file (@testitems) {
}
}
# Check to see that all error messages use tags (for l10n reasons.)
foreach
my
$file
(
@testitems
)
{
$file
=~
s/\s.*$//
;
# nuke everything after the first space (#comment)
next
if
(
!
$file
);
# skip null entries
if
(
!
open
(
FILE
,
$file
))
{
ok
(
0
,
"could not open $file --WARNING"
);
next
;
}
my
$lineno
=
0
;
my
$error
=
0
;
while
(
my
$file_line
=
<
FILE
>
)
{
$lineno
++
;
if
(
$file_line
=~
/Throw.*Error\("(.*?)"/
)
{
if
(
$1
=~
/\s/
)
{
ok
(
0
,
"$file has a Throw*Error call on line $lineno
which doesn't use a tag --ERROR"
);
$error
=
1
;
}
}
}
ok
(
1
,
"$file uses Throw*Error calls correctly"
)
if
!
$error
;
close
(
FILE
);
}
exit
0
;
template/en/default/global/user-error.html.tmpl
View file @
618851e7
...
...
@@ -75,6 +75,10 @@
Bug aliases cannot be longer than 20 characters.
Please choose a shorter alias.
[% ELSIF error == "attachment_access_denied" %]
[% title = "Access Denied" %]
You are not permitted access to this attachment.
[% ELSIF error == "buglist_parameters_required" %]
[% title = "Parameters Required" %]
[% url = "query.cgi" %]
...
...
@@ -155,6 +159,10 @@
[% title = "Invalid Bug ID" %]
The bug id [% bug_id FILTER html %] is invalid.
[% ELSIF error == "invalid_product_name" %]
[% title = "Invalid Product Name" %]
The product name '[% product FILTER html %]' is invalid or does not exist.
[% ELSIF error == "invalid_username" %]
[% title = "Invalid Username" %]
The name <tt>[% name FILTER html %]</tt> is not a valid username.
...
...
@@ -182,6 +190,11 @@
[% title = "No Bugs Chosen" %]
You apparently didn't choose any bugs to modify.
[% ELSIF error == "no_component_change_for_multiple_products" %]
[% title = "Action Not Permitted" %]
You cannot change the component for a list of bugs covering more than
one product.
[% ELSIF error == "no_dupe_stats" %]
[% title = "Cannot Find Duplicate Statistics" %]
There are no duplicate statistics for today ([% today %]) or yesterday.
...
...
@@ -200,6 +213,10 @@
There are no duplicate statistics for today ([% today %]), and an error
occurred opening yesterday's dupes file: [% error_msg FILTER html %].
[% ELSIF error == "no_new_quips" %]
[% title = "No New Quips" %]
This site does not permit the addition of new quips.
[% ELSIF error == "page_not_found" %]
[% title = "Page not found" %]
The page you requested cannot be found.
...
...
@@ -215,6 +232,10 @@
<code>[% keyword FILTER html %]</code> is not a known keyword.
The legal keyword names are <a href="describekeywords.cgi">listed here</a>.
[% ELSIF error == "unknown_tab" %]
[% title = "Unknown Tab" %]
<code>[% current_tab_name FILTER html %]</code> is not a legal tab name.
[% ELSE %]
[%# Cope with legacy calling convention, where "error" was the string
# to print.
...
...
userprefs.cgi
View file @
618851e7
...
...
@@ -395,8 +395,7 @@ SWITCH: for ($current_tab_name) {
DoPermissions
();
last
SWITCH
;
};
ThrowUserError
(
"Unknown tab <code>"
.
html_quote
(
$current_tab_name
)
.
"</code>"
);
ThrowUserError
(
"current_tab_name"
);
}
# Generate and return the UI (HTML page) from the appropriate template.
...
...
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