aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortimeless%mozdev.org <>2007-08-24 10:15:16 +0000
committertimeless%mozdev.org <>2007-08-24 10:15:16 +0000
commitab439a9ac6606f9382bf101b115bdb90bbd85e60 (patch)
tree8057c14c9c3b154503de03d66c2dcd292963651d
parent938fdbf58ef07cc3f2398adbcea435250da15131 (diff)
downloadbugs-ab439a9ac6606f9382bf101b115bdb90bbd85e60.tar
bugs-ab439a9ac6606f9382bf101b115bdb90bbd85e60.tar.gz
bugs-ab439a9ac6606f9382bf101b115bdb90bbd85e60.tar.bz2
bugs-ab439a9ac6606f9382bf101b115bdb90bbd85e60.tar.xz
bugs-ab439a9ac6606f9382bf101b115bdb90bbd85e60.zip
Bug 221827 Missing Bug ID shouldn't be handled as Invalid Bug ID
r=vladd a=mkanat
-rwxr-xr-xBugzilla/Bug.pm4
-rwxr-xr-xBugzilla/WebService/Constants.pm4
-rwxr-xr-xshowdependencytree.cgi2
-rw-r--r--template/en/default/global/user-error.html.tmpl8
4 files changed, 10 insertions, 8 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 33bec5f71..7ed76311f 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2797,7 +2797,7 @@ sub ValidateBugID {
my $alias = $id;
if (!detaint_natural($id)) {
$id = bug_alias_to_id($alias);
- $id || ThrowUserError("invalid_bug_id_or_alias",
+ $id || ThrowUserError("improper_bug_id_field_value",
{'bug_id' => $alias,
'field' => $field });
}
@@ -2808,7 +2808,7 @@ sub ValidateBugID {
# First check that the bug exists
$dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = ?", undef, $id)
- || ThrowUserError("invalid_bug_id_non_existent", {'bug_id' => $id});
+ || ThrowUserError("bug_id_does_not_exist", {'bug_id' => $id});
return if (defined $field && ($field eq "dependson" || $field eq "blocked"));
diff --git a/Bugzilla/WebService/Constants.pm b/Bugzilla/WebService/Constants.pm
index 01359868a..24a0e5d43 100755
--- a/Bugzilla/WebService/Constants.pm
+++ b/Bugzilla/WebService/Constants.pm
@@ -51,8 +51,8 @@ use base qw(Exporter);
# have to fix it here.
use constant WS_ERROR_CODE => {
# Bug errors usually occupy the 100-200 range.
- invalid_bug_id_or_alias => 100,
- invalid_bug_id_non_existent => 101,
+ improper_bug_id_field_value => 100,
+ bug_id_does_not_exist => 101,
bug_access_denied => 102,
invalid_field_name => 108,
# These all mean "invalid alias"
diff --git a/showdependencytree.cgi b/showdependencytree.cgi
index 861dee859..070986d5e 100755
--- a/showdependencytree.cgi
+++ b/showdependencytree.cgi
@@ -49,7 +49,7 @@ my $dbh = Bugzilla->switch_to_shadow_db();
# Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access.
-my $id = $cgi->param('id') || ThrowUserError('invalid_bug_id_or_alias');
+my $id = $cgi->param('id') || ThrowUserError('improper_bug_id_field_value');
ValidateBugID($id);
my $current_bug = new Bugzilla::Bug($id);
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index c91875812..5a33b75c5 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -746,12 +746,14 @@
[% title = "Invalid Attachment ID" %]
The attachment id [% attach_id FILTER html %] is invalid.
- [% ELSIF error == "invalid_bug_id_non_existent" %]
+ [% ELSIF error == "bug_id_does_not_exist" %]
[% title = BLOCK %]Invalid [% terms.Bug %] ID[% END %]
[% terms.Bug %] #[% bug_id FILTER html %] does not exist.
- [% ELSIF error == "invalid_bug_id_or_alias" %]
- [% title = BLOCK %]Invalid [% terms.Bug %] ID[% END %]
+ [% ELSIF error == "improper_bug_id_field_value" %]
+ [% title = BLOCK %]
+ [% IF bug_id %]Invalid [% ELSE %]Missing [% END %] [% terms.Bug %] ID
+ [% END %]
[% IF bug_id %]
'[% bug_id FILTER html %]' is not a valid [% terms.bug %] number
[% IF Param("usebugaliases") %]