]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 221827 Missing Bug ID shouldn't be handled as Invalid Bug ID
authortimeless%mozdev.org <>
Fri, 24 Aug 2007 10:15:16 +0000 (10:15 +0000)
committertimeless%mozdev.org <>
Fri, 24 Aug 2007 10:15:16 +0000 (10:15 +0000)
r=vladd a=mkanat

Bugzilla/Bug.pm
Bugzilla/WebService/Constants.pm
showdependencytree.cgi
template/en/default/global/user-error.html.tmpl

index 33bec5f71d4e70308e95a7a7c0e7343be7701566..7ed76311fd558bb4e193318cc3d94acb7521bfd5 100755 (executable)
@@ -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"));
     
index 01359868aa16ca5716d79c6a4e082f01f241e11c..24a0e5d43eff41d19e79eefdbc1a65ce30b4a508 100755 (executable)
@@ -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"
index 861dee859ce4e589aa40e3504de1a551cfa71427..070986d5ef21e508bb2af05e1368d11366f1a3b6 100755 (executable)
@@ -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);
 
index c9187581283c27302f18d901e8eeb20ef902b3af..5a33b75c5bc6656378f065e3320ca72c7c5a2653 100644 (file)
     [% 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") %]