diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index 782db2bdf..95e668bc1 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -246,7 +246,7 @@ sub getAllCollateral { my $json = $self->get($tableName); my $table; if ($json) { - $table = from_json($json); + $table = decode_json($json); } else { $table = []; @@ -774,7 +774,7 @@ The name of the table to insert the data. sub setAllCollateral { my $self = shift; my $tableName = shift; - my $json = to_json($self->{_collateral}->{$tableName}); + my $json = encode_json($self->{_collateral}->{$tableName}); $self->update({ $tableName => $json }); return; } diff --git a/t/Asset/Sku/ProductCollateral.t b/t/Asset/Sku/ProductCollateral.t index 46f9508e1..d9bc039e7 100644 --- a/t/Asset/Sku/ProductCollateral.t +++ b/t/Asset/Sku/ProductCollateral.t @@ -55,7 +55,7 @@ ok($session->id->valid($vid), 'a valid id was generated for the new collateral e my $json; $json = $product->get('variantsJSON'); -my $jsonData = from_json($json); +my $jsonData = decode_json($json); cmp_deeply( $jsonData, [ {a => 'aye', b => 'bee', vid => $vid } ],