diff --git a/src/Controller/AbstractController.php b/src/Controller/AbstractController.php index 8bc58cc..c916d28 100644 --- a/src/Controller/AbstractController.php +++ b/src/Controller/AbstractController.php @@ -23,6 +23,11 @@ protected function normalizeProduct(EntityWithFamilyVariantInterface $product) { $normalizedProduct = $this->getNormalizer()->normalize($product, 'external_api'); + # @see https://github.com/flagbit/akeneo-product-cloner/issues/24 + if ($normalizedProduct['values'] instanceof \stdClass) { + $normalizedProduct['values'] = []; + } + while ($parent = $product->getParent()) { foreach ($parent->getValuesForVariation() as $value) { //this workaround removes the attributes of all parent models, as the getValues() Method,