From ff222adc4a6cb0349f7642d61bb63d2ff970607c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 13 Jul 2007 18:10:39 +0000 Subject: Bug 385415: Bugs marked as duplicate or moved to another installation always go to the RESOLVED state, even if the workflow has RESOLVED excluded from it (or if this bug status has been removed or renamed). Some major problems related to the workflow when upgrading or installing 3.1 are also fixed here - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Config/BugChange.pm | 22 ++++++++++++++++++++++ Bugzilla/Config/Common.pm | 12 +++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Config') diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm index 6941f0046..65b2aec96 100644 --- a/Bugzilla/Config/BugChange.pm +++ b/Bugzilla/Config/BugChange.pm @@ -34,12 +34,34 @@ package Bugzilla::Config::BugChange; use strict; use Bugzilla::Config::Common; +use Bugzilla::Status; $Bugzilla::Config::BugChange::sortkey = "03"; sub get_param_list { my $class = shift; + + # Hardcoded bug statuses which existed before Bugzilla 3.1. + my @closed_bug_statuses = ('RESOLVED', 'VERIFIED', 'CLOSED'); + + # If we are upgrading from 3.0 or older, bug statuses are not customisable + # and bug_status.is_open is not yet defined (hence the eval), so we use + # the bug statuses above as they are still hardcoded. + eval { + my @current_closed_states = map {$_->name} Bugzilla::Status::closed_bug_statuses(); + # If no closed state was found, use the default list above. + @closed_bug_statuses = @current_closed_states if scalar(@current_closed_states); + }; + my @param_list = ( + { + name => 'duplicate_or_move_bug_status', + type => 's', + choices => \@closed_bug_statuses, + default => $closed_bug_statuses[0], + checker => \&check_bug_status + }, + { name => 'letsubmitterchoosepriority', type => 'b', diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 0d6db5257..188ef0c90 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -40,6 +40,7 @@ use Bugzilla::Util; use Bugzilla::Constants; use Bugzilla::Field; use Bugzilla::Group; +use Bugzilla::Status; use base qw(Exporter); @Bugzilla::Config::Common::EXPORT = @@ -48,7 +49,7 @@ use base qw(Exporter); check_opsys check_shadowdb check_urlbase check_webdotbase check_netmask check_user_verify_class check_image_converter check_languages check_mail_delivery_method check_notification - check_timezone check_utf8 + check_timezone check_utf8 check_bug_status ); # Checking functions for the various values @@ -166,6 +167,15 @@ sub check_opsys { return ""; } +sub check_bug_status { + my $bug_status = shift; + my @closed_bug_statuses = map {$_->name} Bugzilla::Status::closed_bug_statuses(); + if (lsearch(\@closed_bug_statuses, $bug_status) < 0) { + return "Must be a valid closed status: one of " . join(', ', @closed_bug_statuses); + } + return ""; +} + sub check_group { my $group_name = shift; return "" unless $group_name; -- cgit v1.2.3-24-g4f1b