summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorGervase Markham <gerv@gerv.net>2015-03-30 19:53:57 +0200
committerGervase Markham <gerv@gerv.net>2015-03-30 19:53:57 +0200
commit79ec29975ac8d1a4f49b83ed404a1ee04c33b73c (patch)
treefd747279bdfb8f3857e7e64468c0915649319523 /Bugzilla
parent2c82105b0fed5d6739111c5de8dba063b01ab446 (diff)
downloadbugzilla-79ec29975ac8d1a4f49b83ed404a1ee04c33b73c.tar.gz
bugzilla-79ec29975ac8d1a4f49b83ed404a1ee04c33b73c.tar.xz
Bug 1007605 - Make FIXED non-fixed, by changing noresolveonopenblockers to define what the fixed resolution is. r,a=glob
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Bug.pm7
-rw-r--r--Bugzilla/Config.pm4
-rw-r--r--Bugzilla/Config/BugChange.pm13
-rw-r--r--Bugzilla/Config/Common.pm16
-rw-r--r--Bugzilla/Field/ChoiceInterface.pm3
-rw-r--r--Bugzilla/WebService/Bugzilla.pm4
6 files changed, 36 insertions, 11 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 2bd6fb646..fc5dbc678 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1937,11 +1937,12 @@ sub _check_resolution {
# Don't allow open bugs to have resolutions.
ThrowUserError('resolution_not_allowed') if $is_open;
- # Check noresolveonopenblockers.
+ # Check if resolution_forbidden_with_open_blockers.
my $dependson = ref($invocant) ? $invocant->dependson
: ($params->{dependson} || []);
- if (Bugzilla->params->{"noresolveonopenblockers"}
- && $resolution eq 'FIXED'
+ if (Bugzilla->params->{"resolution_forbidden_with_open_blockers"}
+ && $resolution eq
+ Bugzilla->params->{"resolution_forbidden_with_open_blockers"}
&& (!ref $invocant or !$invocant->resolution
or $resolution ne $invocant->resolution)
&& scalar @$dependson)
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm
index ebd5f8ef6..51d65397e 100644
--- a/Bugzilla/Config.pm
+++ b/Bugzilla/Config.pm
@@ -204,6 +204,10 @@ sub update_params {
$new_params{'search_allow_no_criteria'} = $param->{'specific_search_allow_empty_words'};
}
+ if (exists $param->{'noresolveonopenblockers'}) {
+ $new_params{'resolution_forbidden_with_open_blockers'} = $param->{'noresolveonopenblockers'} ? 'FIXED' : "";
+ }
+
# --- DEFAULTS FOR NEW PARAMS ---
_load_params unless %params;
diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm
index 0acdc0ce4..2a225b794 100644
--- a/Bugzilla/Config/BugChange.pm
+++ b/Bugzilla/Config/BugChange.pm
@@ -31,6 +31,10 @@ sub get_param_list {
@closed_bug_statuses = @current_closed_states if scalar(@current_closed_states);
};
+ my $resolution_field = Bugzilla::Field->new({ name => 'resolution', cache => 1 });
+ # The empty resolution is included - it represents "no value"
+ my @resolutions = map {$_->name} @{ $resolution_field->legal_values };
+
my @param_list = (
{
name => 'duplicate_or_move_bug_status',
@@ -71,10 +75,13 @@ sub get_param_list {
},
{
- name => 'noresolveonopenblockers',
- type => 'b',
- default => 0,
+ name => 'resolution_forbidden_with_open_blockers',
+ type => 's',
+ choices => \@resolutions,
+ default => '',
+ checker => \&check_resolution,
} );
+
return @param_list;
}
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 52a2f8f11..95b1e3189 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -28,7 +28,7 @@ use parent qw(Exporter);
check_ip check_mail_delivery_method check_notification
check_bug_status check_smtp_auth check_theschwartz_available
check_maxattachmentsize check_email check_smtp_ssl
- check_comment_taggers_group check_smtp_server
+ check_comment_taggers_group check_smtp_server check_resolution
);
# Checking functions for the various values
@@ -164,6 +164,18 @@ sub check_bug_status {
return "";
}
+sub check_resolution {
+ my $resolution = shift;
+ my $resolution_field = Bugzilla::Field->new({ name => 'resolution', cache => 1 });
+ # The empty resolution is included - it represents "no value"
+ my @resolutions = map {$_->name} @{ $resolution_field->legal_values };
+
+ if (!grep($_ eq $resolution, @resolutions)) {
+ return "Must be blank or a valid resolution: one of " . join(', ', @resolutions);
+ }
+ return "";
+}
+
sub check_group {
my $group_name = shift;
return "" unless $group_name;
@@ -464,6 +476,8 @@ valid group is provided.
=item check_bug_status
+=item check_resolution
+
=item check_shadowdb
=item check_smtp_server
diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm
index 634d36ad1..9ac508dc0 100644
--- a/Bugzilla/Field/ChoiceInterface.pm
+++ b/Bugzilla/Field/ChoiceInterface.pm
@@ -88,8 +88,7 @@ sub is_static {
# If we need to special-case Resolution for *anything* else, it should
# get its own subclass.
if ($self->field->name eq 'resolution') {
- return grep($_ eq $self->name, ('', 'FIXED', 'DUPLICATE'))
- ? 1 : 0;
+ return $self->name eq '' || $self->name eq 'DUPLICATE';
}
elsif ($self->field->custom) {
return $self->name eq '---' ? 1 : 0;
diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm
index 45ef326ac..f94ea55c9 100644
--- a/Bugzilla/WebService/Bugzilla.pm
+++ b/Bugzilla/WebService/Bugzilla.pm
@@ -71,10 +71,10 @@ use constant PARAMETERS_LOGGED_IN => qw(
maxattachmentsize
maxlocalattachment
musthavemilestoneonaccept
- noresolveonopenblockers
password_complexity
rememberlogin
requirelogin
+ resolution_forbidden_with_open_blockers
search_allow_no_criteria
urlbase
use_see_also
@@ -428,10 +428,10 @@ A logged-in user can access the following parameters (listed alphabetically):
C<maxattachmentsize>,
C<maxlocalattachment>,
C<musthavemilestoneonaccept>,
- C<noresolveonopenblockers>,
C<password_complexity>,
C<rememberlogin>,
C<requirelogin>,
+ C<resolution_forbidden_with_open_blockers>,
C<search_allow_no_criteria>,
C<urlbase>,
C<use_see_also>,