projects
/
Net-OpenSRS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
498afde
)
correct denastification to handle single element dt_assoc (eg response to belongs_to_rsp)
author
jeff
<jeff>
Sun, 27 Jun 2010 21:02:38 +0000
(21:02 +0000)
committer
jeff
<jeff>
Sun, 27 Jun 2010 21:02:38 +0000
(21:02 +0000)
Changes
patch
|
blob
|
history
lib/Net/OpenSRS.pm
patch
|
blob
|
history
diff --git
a/Changes
b/Changes
index
5c4d457
..
e362b8e
100644
(file)
--- a/
Changes
+++ b/
Changes
@@
-11,3
+11,7
@@
0.04
- Correct de-nastification to handle lists
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
(file)
--- 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 /;
use Digest::MD5;
use Date::Calc qw/ Add_Delta_Days Today This_Year /;
-our $VERSION = '0.0
4
';
+our $VERSION = '0.0
5
';
my $rv;
*hash = \&Digest::MD5::md5_hex;
my $rv;
*hash = \&Digest::MD5::md5_hex;
@@
-1254,7
+1254,9
@@
sub _denastify {
@$array
];
} elsif ( exists( $arg->{dt_assoc} ) ) {
@$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 );
}
}
return ( $arg->{key} => $value );
}