From: justdave%bugzilla.org <> Date: Thu, 11 Sep 2008 00:16:33 +0000 (+0000) Subject: Bug 452793 part 2: On bug creation, the first confirmed bug status should be selected... X-Git-Tag: bugzilla-3.2rc2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08d7a0c71b060c30f5dd16d019d0f101d9cac31a;p=thirdparty%2Fbugzilla.git Bug 452793 part 2: On bug creation, the first confirmed bug status should be selected by default for users with canconfirm privs, even if UNCONFIRMED is the bug status with the lowest sortkey -- do this when the template doesn't specify a status also (first patch only fixed the default templates). Patch by justdave/LpSolit, r=LpSolit/justdave, a=LpSolit --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index ad1ffc4444..ffae17895f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -942,7 +942,15 @@ sub _check_bug_status { || $user->in_group('canconfirm', $product->id)) { # If the user with privs hasn't selected another status, # select the first one of the list. - $new_status ||= $valid_statuses[0]; + unless ($new_status) { + if (scalar(@valid_statuses) == 1) { + $new_status = $valid_statuses[0]; + } + else { + $new_status = ($valid_statuses[0]->name ne 'UNCONFIRMED') ? + $valid_statuses[0] : $valid_statuses[1]; + } + } } else { # A user with no privs cannot choose the initial status.