# 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)
$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;
@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',
},
{
- name => 'noresolveonopenblockers',
- type => 'b',
- default => 0,
+ name => 'resolution_forbidden_with_open_blockers',
+ type => 's',
+ choices => \@resolutions,
+ default => '',
+ checker => \&check_resolution,
} );
+
return @param_list;
}
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
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;
=item check_bug_status
+=item check_resolution
+
=item check_shadowdb
=item check_smtp_server
# 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;
maxattachmentsize
maxlocalattachment
musthavemilestoneonaccept
- noresolveonopenblockers
password_complexity
rememberlogin
requirelogin
+ resolution_forbidden_with_open_blockers
search_allow_no_criteria
urlbase
use_see_also
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>,
any comment as to what the fix was (or even that it was truly
fixed!)
-noresolveonopenblockers
- This option will prevent users from resolving bugs as FIXED if
- they have unresolved dependencies. Only the FIXED resolution
- is affected. Users will be still able to resolve bugs to
- resolutions other than FIXED if they have unresolved dependent
- bugs.
+resolution_forbidden_with_open_blockers
+ This option will prevent users from resolving bugs as the chosen resolution
+ if they have unresolved dependencies. If using Bugzilla's default
+ resolutions, the most common value to choose is FIXED, because if a bug
+ is fixed, either is dependencies are actually fixed (and should be marked
+ as such) or the dependency is mistaken and should be removed. Only the
+ chosen resolution is affected; users will be still able to resolve bugs to
+ other resolutions even if they have unresolved dependent bugs.
.. _param-bugfields:
"maxattachmentsize" : "1000",
"maxlocalattachment" : "0",
"musthavemilestoneonaccept" : "0",
- "noresolveonopenblockers" : "0",
"password_complexity" : "no_constraints",
"rememberlogin" : "on",
"requirelogin" : "0",
+ "resolution_forbidden_with_open_blockers" : "FIXED",
"urlbase" : "http://bugzilla.example.com/",
"use_see_also" : "1",
"useclassification" : "1",
* maxattachmentsize
* maxlocalattachment
* musthavemilestoneonaccept
-* noresolveonopenblockers
* password_complexity
* rememberlogin
* requirelogin
+* resolution_forbidden_with_open_blockers
* search_allow_no_criteria
* urlbase
* use_see_also
commentonduplicate => "If this option is on, the user needs to enter a short comment " _
"if the $terms.bug is marked as duplicate.",
- noresolveonopenblockers => "Don\'t allow $terms.bugs to be resolved as fixed " _
- "if they have unresolved dependencies." }
+ resolution_forbidden_with_open_blockers => "Don't allow $terms.bugs to be resolved with " _
+ "this resolution if they have unresolved dependencies." }
%]
[% END %].
They must either be resolved or removed from the
"[% field_descs.dependson FILTER html %]" field before you can resolve
- this [% terms.bug %] as [% display_value("resolution", "FIXED") FILTER html %].
+ this [% terms.bug %] as [% display_value("resolution",
+ Param('resolution_forbidden_with_open_blockers')) FILTER html %].
[% ELSIF error == "sudo_invalid_cookie" %]
[% title = "Invalid Sudo Cookie" %]