Skip to content
Permalink
Browse files

Allow PseudoRequest to handle 0 and '' correctly. Kudos to knowmad fo…

…r pointing this behavior out.
  • Loading branch information...
perlDreamer committed Sep 29, 2011
1 parent f33c19d commit c17d9aa394e01d7c4941d73af122c632fd006ea7
Showing with 3 additions and 3 deletions.
  1. +2 −2 t/Asset/EMSSubmissionForm.t
  2. +1 −1 t/lib/WebGUI/PseudoRequest.pm
@@ -432,10 +432,10 @@ my $expected = {
},
'description' => undef,
'_isValid' => 1,
'deleteCreatedItems' => undef,
'deleteCreatedItems' => 0,
'canSubmitGroupId' => '2',
'assetId' => 'new',
'url' => undef,
'url' => '',
'daysBeforeCleanup' => '7',
'title' => 'Untitled',
} ;
@@ -87,7 +87,7 @@ sub body {
return keys %{ $self->{body} } if wantarray;
return { %{ $self->{body} } };
}
if ($self->{body}->{$value}) {
if (defined $self->{body}->{$value}) {
if (wantarray && ref $self->{body}->{$value} eq "ARRAY") {
return @{$self->{body}->{$value}};
}

0 comments on commit c17d9aa

Please sign in to comment.
You can’t perform that action at this time.