FriendsOfAkeneo / ExtendedAttributeTypeBundle

Extra attribute types for Akeneo PIM
23 stars 19 forks source link

StandardToFlat ValueConverter tries to implode NULL values #29

Closed masmrlar closed 7 years ago

masmrlar commented 7 years ago

The StandardToFlat ValueConverter tries to implode NULL values (if no values are set on the products) causing errors in log. Though the export works this should be handled.

This is the stack trace:

Warning: implode(): Invalid arguments passed in /var/www/vendor/akeneo/extended-attribute-type/src/ArrayConverter/StandardToFlat/Product/ValueConverter/TextCollectionConverter.php on line 57
...  
140.1178   25499000  15. Pim\Component\Connector\ArrayConverter\StandardToFlat\ProductLocalized->convert(???, ???) /var/www/vendor/akeneo/pim-community-dev/src/Pim/Component/Connector/Writer/File/AbstractItemMediaWriter.php:120
  140.1451   25535400  16. Pim\Component\Connector\ArrayConverter\StandardToFlat\Product->convert(???, ???) /var/www/vendor/akeneo/pim-community-dev/src/Pim/Component/Connector/ArrayConverter/StandardToFlat/ProductLocalized.php:44
  140.1454   25535776  17. Pim\Component\Connector\ArrayConverter\StandardToFlat\Product->convertProperty(???, ???, ???, ???) /var/www/vendor/akeneo/pim-community-dev/src/Pim/Component/Connector/ArrayConverter/StandardToFlat/AbstractSimpleArrayConverter.php:25
  140.1626   25565832  18. Pim\Component\Connector\ArrayConverter\StandardToFlat\Product\ProductValueConverter->convertAttribute(???, ???) /var/www/vendor/akeneo/pim-community-dev/src/Pim/Component/Connector/ArrayConverter/StandardToFlat/Product.php:52
  140.1644   25565832  19. Pim\Bundle\ExtendedAttributeTypeBundle\ArrayConverter\StandardToFlat\Product\ValueConverter\TextCollectionConverter->convert(???, ???) /var/www/vendor/akeneo/pim-community-dev/src/Pim/Component/Connector/ArrayConverter/StandardToFlat/Product/ProductValueConverter.php:55
  140.1644   25565832  20. implode(???, ???) /var/www/vendor/akeneo/extended-attribute-type/src/ArrayConverter/StandardToFlat/Product/ValueConverter/TextCollectionConverter.php:57

And the local variables:

Variables in local scope (#19):
  $arrayValues = NULL
  $attributeCode = 'fancyTextCollectionAttribute'
  $convertedItem = array ()
  $data = array (0 => array ('locale' => NULL, 'scope' => NULL, 'data' => NULL))
  $flatName = 'fancyTextCollectionAttribute'
  $value = array ('locale' => NULL, 'scope' => NULL, 'data' => NULL)
masmrlar commented 7 years ago

See also https://github.com/akeneo/ExtendedAttributeTypeBundle/pull/30

jmleroux commented 7 years ago

Hello @masmrlar ,

sorry for the delay, i didn't see this issue in time. I'll take a look at your PR.

Regards, JM

jmleroux commented 7 years ago

Fixed in v1.0.1 an v1.1.1. See also #33

Thx @masmrlar for raising AND fixing the issue :+1: