Dereference the array ref of collateral into an array so foreach

can iterate over it.
This commit is contained in:
Colin Kuskie 2008-09-30 22:09:54 +00:00
parent 135d8f5257
commit dec515d1cf

View file

@ -81,7 +81,7 @@ sub repairBrokenProductSkus {
print "\tRepairing broken Products that were imported... " unless $quiet;
my $getAProduct = WebGUI::Asset::Sku::Product->getIsa($session);
while (my $product = $getAProduct->()) {
COLLATERAL: foreach my $collateral ($product->getAllCollateral('variantsJSON')) {
COLLATERAL: foreach my $collateral (@{ $product->getAllCollateral('variantsJSON') }) {
next COLLATERAL unless exists $collateral->{sku};
$collateral->{varSku} = $collateral->{sku};
delete $collateral->{sku};