akeneo-labs / EnhancedConnectorBundle

[DEPRECATED] Provides product reader with more option (choice on completeness, choice on enabled, delta based on last export time).
21 stars 11 forks source link

Troubleshooting on Products #84

Closed mauriau closed 7 years ago

mauriau commented 7 years ago

Hi !

Since I migrate to MongoDB I got some troubles shooting with this connector. In first time we got Catchable Fatal Error: Argument 1 passed to Pim\Bundle\TransformBundle\Converter\MetricConverter::convert() must implement interface Pim\Component\Catalog\Model\ProductInterface, boolean given, called in pim/vendor/akeneo-labs/pim-enhanced-connector/Reader/ProductReader.php on line 392 and defined The error happend because $productis false. But we dont why the product is false and not instance of ProductInterface.

So we overload (pim/vendor/akeneo-labs/pim-enhanced-connector/Reader/ProductReader.php) with a small fix : replace in reader() at line 390 if (null !== $product) by if ($product) and adding logger to know the previous sku and the type of $product. And we saw $product is false.

But we got other trouble shooting in Processor : Catchable Fatal Error: Argument 1 passed to Pim\Bundle\CatalogBundle\Builder\ProductBuilder::addMissingProductValues() must implement interface Pim\Component\Catalog\Model\ProductInterface, *boolean* given, called in pim/vendor/akeneo/pim-community-dev/src/Pim/Bundle/BaseConnectorBundle/Processor/ProductToFlatArrayProcessor.php on line 99 for the same reason : the processor get the $product but this variable is false

If we fix it we should have the same error on the writer.

And if we re-export with the same job and same channel the error doesnt come back.

Thx for helping :)

jmleroux commented 7 years ago

fixed by #87