]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 343364: Changing Multiple Bugs is broken - Patch by Olav Vitters <bugzilla-mozill...
authorlpsolit%gmail.com <>
Mon, 3 Jul 2006 16:21:42 +0000 (16:21 +0000)
committerlpsolit%gmail.com <>
Mon, 3 Jul 2006 16:21:42 +0000 (16:21 +0000)
Bugzilla/Bug.pm

index 91a92cbe2e999348787685bcc1d48f0866bc30ac..857557def3be28f1ceae567a4871b9bec6a714fa 100755 (executable)
@@ -107,13 +107,6 @@ sub initBug  {
   # If the bug ID isn't numeric, it might be an alias, so try to convert it.
   $bug_id = bug_alias_to_id($bug_id) if $bug_id !~ /^0*[1-9][0-9]*$/;
 
-  if ((! defined $bug_id) || (!$bug_id) || (!detaint_natural($bug_id))) {
-      # no bug number given or the alias didn't match a bug
-      $self->{'bug_id'} = $old_bug_id;
-      $self->{'error'} = "InvalidBugId";
-      return $self;
-  }
-
   # If the user is not logged in, sets $user_id to 0.
   # Else gets $user_id from the user login name if this
   # argument is not numeric.
@@ -126,6 +119,13 @@ sub initBug  {
 
   $self->{'who'} = new Bugzilla::User($user_id);
 
+  if ((! defined $bug_id) || (!$bug_id) || (!detaint_natural($bug_id))) {
+      # no bug number given or the alias didn't match a bug
+      $self->{'bug_id'} = $old_bug_id;
+      $self->{'error'} = "InvalidBugId";
+      return $self;
+  }
+
     my $custom_fields = "";
     if (scalar(Bugzilla->custom_field_names) > 0) {
         $custom_fields = ", " . join(", ", Bugzilla->custom_field_names);