fixed form processing of yes/no fields
This commit is contained in:
parent
fe734f2359
commit
9bcc48f123
1 changed files with 3 additions and 10 deletions
|
|
@ -109,16 +109,9 @@ An optional value to process, instead of POST input. This should be in the form
|
|||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue;
|
||||
|
||||
if (@_) {
|
||||
my $value = shift;
|
||||
return '' unless length $value; # empty import value?
|
||||
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
return $self->SUPER::getValueFromPost;
|
||||
}
|
||||
my $value = shift;
|
||||
$value = $self->SUPER::getValueFromPost unless (defined $value);
|
||||
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue