Commit b494561c authored by Thorsten Schöning's avatar Thorsten Schöning Committed by Frédéric Buclin

Bug 385283: bz_webservice_demo.pl --product-name fails (Product.get_product no longer exists)

Part 2: correctly display components, milestones and versions r/a=LpSolit
parent 0ec77fdc
...@@ -301,16 +301,24 @@ The call will return a C<Bugzilla::Product> object. ...@@ -301,16 +301,24 @@ The call will return a C<Bugzilla::Product> object.
if ($product_name) { if ($product_name) {
$soapresult = $proxy->call('Product.get', {'names' => [$product_name]}); $soapresult = $proxy->call('Product.get', {'names' => [$product_name]});
_die_on_fault($soapresult); _die_on_fault($soapresult);
$result = $soapresult->result; $result = $soapresult->result()->{'products'}->[0];
if (ref($result) eq 'HASH') { # Iterate all entries, the values may be scalars or array refs with hash refs.
$result = $result->{'products'}->[0]; foreach my $key (sort(keys %$result)) {
foreach (keys(%$result)) { my $value = $result->{$key};
print "$_: $result->{$_}\n";
if (ref($value)) {
my $counter = 0;
foreach my $hash (@$value) {
while (my ($innerKey, $innerValue) = each %$hash) {
print "$key.$counter.$innerKey: $innerValue\n";
}
++$counter;
} }
} }
else { else {
print "$result\n"; print "$key: $value\n"
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment