Subject: | get_value() for first element always returns empty string |
Date: | Wed, 20 Nov 2013 11:59:09 -0800 |
To: | bug-HTML-TurboForm [...] rt.cpan.org |
From: | Adrian Yee <adrian [...] gt.net> |
get_value() always returns an empty string if it's the first element in
the element array. The following patch fixes this:
--- HTML/TurboForm.pm.orig 2013-11-20 11:56:47.504626516 -0800
+++ HTML/TurboForm.pm 2013-11-20 11:56:51.980267223 -0800
@@ -521,12 +521,12 @@
my ($self, $name)=@_;
my $result='';
- my $id='';
+ my $id;
try{
$id=$self->{element_index}->{$self->{prefix}.$name}->{index};
};
- $result=$self->{element}[$id]->get_value() if ($id);
+ $result=$self->{element}[$id]->get_value() if (defined $id);
return $result;
}