Skip Menu |

This queue is for tickets about the SimpleDB-Class CPAN distribution.

Report information
The Basics
Id: 54786
Status: resolved
Priority: 0/
Queue: SimpleDB-Class

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: SimpleDB::Class::HTTP should use XML::Simple with ForceArray for Item entries
SimpleDB::Class::HTTP would be a bit more user friendly on a standalone basis if the results always came back with Item as an array ref. A patch to do so is attached. It might require some additional alterations in SimpleDB::Class::ResultSet, particularly for count(*), but I didn't have time to really grok it all. -- David
Subject: force-array.diff
diff --git a/lib/SimpleDB/Class/HTTP.pm b/lib/SimpleDB/Class/HTTP.pm index 7495c77..b796bc5 100644 --- a/lib/SimpleDB/Class/HTTP.pm +++ b/lib/SimpleDB/Class/HTTP.pm @@ -224,7 +224,9 @@ The HTTP headers. sub handle_response { my ($self, $response) = @_; - my $content = eval {XML::Simple::XMLin($response->content)}; + my $content = eval { + XML::Simple::XMLin($response->content, ForceArray => ['Item']) + }; # choked reconstituing the XML, probably because it wasn't XML if ($@) {
Patched applied in 1.0000, which will be released next week.