diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev
index 8fedfdfd54e..2d905204ff6 100644
--- a/mozilla/webtools/bugzilla/.bzrrev
+++ b/mozilla/webtools/bugzilla/.bzrrev
@@ -1 +1 @@
-7169
\ No newline at end of file
+7170
\ No newline at end of file
diff --git a/mozilla/webtools/bugzilla/Bugzilla/CGI.pm b/mozilla/webtools/bugzilla/Bugzilla/CGI.pm
index 75b7f18d7d8..00f23c393c0 100644
--- a/mozilla/webtools/bugzilla/Bugzilla/CGI.pm
+++ b/mozilla/webtools/bugzilla/Bugzilla/CGI.pm
@@ -329,6 +329,14 @@ sub _fix_utf8 {
return $input;
}
+sub should_set {
+ my ($self, $param) = @_;
+ my $set = (defined $self->param($param)
+ or defined $self->param("defined_$param"))
+ ? 1 : 0;
+ return $set;
+}
+
# The various parts of Bugzilla which create cookies don't want to have to
# pass them around to all of the callers. Instead, store them locally here,
# and then output as required from |header|.
diff --git a/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm b/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm
index 95fb4bf82e4..e4cb4406aeb 100644
--- a/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm
+++ b/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm
@@ -61,7 +61,7 @@ use constant VALIDATORS => {
value => \&_check_value,
sortkey => \&_check_sortkey,
visibility_value_id => \&_check_visibility_value_id,
- isactive => \&Bugzilla::Object::check_boolean,
+ isactive => \&_check_isactive,
};
use constant CLASS_MAP => {
@@ -216,6 +216,25 @@ sub set_visibility_value {
# Validators #
##############
+sub _check_isactive {
+ my ($invocant, $value) = @_;
+ $value = Bugzilla::Object::check_boolean($invocant, $value);
+ if (!$value and ref $invocant) {
+ if ($invocant->is_default) {
+ my $field = $invocant->field;
+ ThrowUserError('fieldvalue_is_default',
+ { value => $invocant, field => $field,
+ param_name => $invocant->DEFAULT_MAP->{$field->name}
+ });
+ }
+ if ($invocant->is_static) {
+ ThrowUserError('fieldvalue_not_deletable',
+ { value => $invocant, field => $invocant->field });
+ }
+ }
+ return $value;
+}
+
sub _check_value {
my ($invocant, $value) = @_;
diff --git a/mozilla/webtools/bugzilla/editvalues.cgi b/mozilla/webtools/bugzilla/editvalues.cgi
index b651b23c293..a9538523022 100755
--- a/mozilla/webtools/bugzilla/editvalues.cgi
+++ b/mozilla/webtools/bugzilla/editvalues.cgi
@@ -181,12 +181,12 @@ if ($action eq 'edit') {
if ($action eq 'update') {
check_token_data($token, 'edit_field_value');
$vars->{'value_old'} = $value->name;
+ if ($cgi->should_set('is_active')) {
+ $value->set_is_active($cgi->param('is_active'));
+ }
$value->set_name($cgi->param('value_new'));
$value->set_sortkey($cgi->param('sortkey'));
$value->set_visibility_value($cgi->param('visibility_value_id'));
- if (!($value->is_static || $value->is_default)) {
- $value->set_is_active($cgi->param('is_active'));
- }
$vars->{'changes'} = $value->update();
delete_token($token);
$vars->{'message'} = 'field_value_updated';
diff --git a/mozilla/webtools/bugzilla/template/en/default/admin/fieldvalues/edit.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/admin/fieldvalues/edit.html.tmpl
index fb58e578444..9c42ce639c1 100644
--- a/mozilla/webtools/bugzilla/template/en/default/admin/fieldvalues/edit.html.tmpl
+++ b/mozilla/webtools/bugzilla/template/en/default/admin/fieldvalues/edit.html.tmpl
@@ -94,7 +94,11 @@
[% ELSIF value.is_static %]
This value is non-deletable and cannot be disabled.
[% END %]
-
+ [% IF !(value.is_default OR value.is_static) %]
+
+ [% END %]
+
diff --git a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl
index 5fdcee8f3de..279f29c71fe 100644
--- a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl
+++ b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl
@@ -521,7 +521,8 @@
[% ELSIF error == "fieldvalue_is_default" %]
[% title = "Specified Field Value Is Default" %]
'[% value.name FILTER html %]' is the default value for
- the '[% field.description FILTER html %]' field and cannot be deleted.
+ the '[% field.description FILTER html %]' field and cannot be deleted
+ or disabled.
[% IF user.in_group('tweakparams') %]
You have to change the default value first.
@@ -541,9 +542,9 @@
[% ELSIF error == "fieldvalue_not_deletable" %]
[% title = "Field Value Not Deletable" %]
- The value '[% value.name FILTER html %]' cannot be removed because
- it plays some special role for the '[% field.description FILTER html %]'
- field.
+ The value '[% value.name FILTER html %]' cannot be removed or
+ disabled, because it plays some special role for the
+ '[% field.description FILTER html %]' field.
[% ELSIF error == "fieldvalue_reserved_word" %]
[% title = "Reserved Word Not Allowed" %]