diff options
author | jeff <jeff> | 2010-06-27 21:02:38 +0000 |
---|---|---|
committer | jeff <jeff> | 2010-06-27 21:02:38 +0000 |
commit | d9a576a11560f7ca71f66cd017fbcdd974053509 (patch) | |
tree | 9343a2ad77573325b346765341563c6761f76b8d | |
parent | 498afdeac8e04c3fb4314bc2a90f29c5a88a1bcc (diff) |
correct denastification to handle single element dt_assoc (eg response to belongs_to_rsp)
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | lib/Net/OpenSRS.pm | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -11,3 +11,7 @@ 0.04 - Correct de-nastification to handle lists + +0.05 Sun Jun 27 16:54:23 EDT 2010 + - Correct de-nastification to handle single item dt_assoc + (eg belongs_to_rsp response) diff --git a/lib/Net/OpenSRS.pm b/lib/Net/OpenSRS.pm index f1db5bf..07f2e3e 100644 --- a/lib/Net/OpenSRS.pm +++ b/lib/Net/OpenSRS.pm @@ -150,7 +150,7 @@ use XML::Simple; use Digest::MD5; use Date::Calc qw/ Add_Delta_Days Today This_Year /; -our $VERSION = '0.04'; +our $VERSION = '0.05'; my $rv; *hash = \&Digest::MD5::md5_hex; @@ -1254,7 +1254,9 @@ sub _denastify { @$array ]; } elsif ( exists( $arg->{dt_assoc} ) ) { - $value = { map { _denastify($_) } @{ $arg->{dt_assoc} } }; + my $array = $arg->{dt_assoc}; + $array = [ $array ] unless ref($array) eq 'ARRAY'; + $value = { map { _denastify($_) } @$array }; } return ( $arg->{key} => $value ); } |