diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-22 18:33:58 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-22 18:33:58 -0700 |
commit | b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7 (patch) | |
tree | 095f71c6c259983217c74b09ad9214d120a589a4 /Bugzilla/Field | |
parent | e11091837644b7d5c2ddbea657548ae222c2884b (diff) | |
download | bugs-b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7.tar bugs-b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7.tar.gz bugs-b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7.tar.bz2 bugs-b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7.tar.xz bugs-b1fa012bc8f89aa7a4a86cc2b7d97d68136358f7.zip |
Bug 577054: ChoiceInterface was denying the deletion of any value if
the field had *any* value-controlling values.
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/Field')
-rw-r--r-- | Bugzilla/Field/ChoiceInterface.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm index a718377c2..894ce00d3 100644 --- a/Bugzilla/Field/ChoiceInterface.pm +++ b/Bugzilla/Field/ChoiceInterface.pm @@ -39,11 +39,11 @@ sub FIELD_NAME { return $_[0]->DB_TABLE; } sub _check_if_controller { my $self = shift; my $vis_fields = $self->controls_visibility_of_fields; - my $values = $self->controlled_values; - if (@$vis_fields || scalar(keys %$values)) { + my $values = $self->controlled_values_array; + if (@$vis_fields || @$values) { ThrowUserError('fieldvalue_is_controller', { value => $self, fields => [map($_->name, @$vis_fields)], - vals => $values }); + vals => $self->controlled_values }); } } @@ -142,6 +142,12 @@ sub controlled_values { return $self->{controlled_values}; } +sub controlled_values_array { + my ($self) = @_; + my $values = $self->controlled_values; + return [map { @{ $values->{$_} } } keys %$values]; +} + sub is_visible_on_bug { my ($self, $bug) = @_; |