From ec25cf5bed0c2fa628006ae5534fcb3faed36cc8 Mon Sep 17 00:00:00 2001 From: "justdave%bugzilla.org" Date: Wed, 10 Sep 2008 19:21:29 +0000 Subject: [PATCH] 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 git-svn-id: svn://10.0.0.236/trunk@254148 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/Bug.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm index 14f781c42f3..6f22d967c45 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm @@ -1020,7 +1020,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.