aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field
diff options
context:
space:
mode:
authoredenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-30 22:29:18 +0000
committeredenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-30 22:29:18 +0000
commit486ed16ffb700527b9cf02a3fc17d9f7ce0776e3 (patch)
tree8fbe0adf0b13ee721ac0b7f232254891a9ca8f1a /lib/Reaction/UI/ViewPort/Field
parent8b55efe277d06027502f9d6b9727c8e584ef708e (diff)
downloadreaction-486ed16ffb700527b9cf02a3fc17d9f7ce0776e3.tar.gz
reaction-486ed16ffb700527b9cf02a3fc17d9f7ce0776e3.zip
adding logic to deal with unset option in a ChooseOne
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field')
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
index dba1a6d..92a4f2e 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
@@ -11,6 +11,10 @@ with 'Reaction::UI::ViewPort::Field::Role::Choices';
sub adopt_value_string {
my ($self) = @_;
my $value = $self->value_string;
+ if(!defined($value) or !length $value) {
+ $self->clear_value;
+ return;
+ }
$value = $self->str_to_ident($value) if (!ref $value);
my $attribute = $self->attribute;
my $checked = $attribute->check_valid_value($self->model, $value);