akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
87 stars 89 forks source link

setCategory step failed due to no imported categories #653

Open Melleschepers opened 1 year ago

Melleschepers commented 1 year ago

Environment and configuration

  1. Akeneo connector v103.5.0 Issue is introduced in https://github.com/akeneo/magento2-connector-community/commit/8b9ffb2c1724e9e05de4d8f82140a9f217042334

Steps to reproduce

  1. Have a setup where you don't import any categories from Akeneo image of settings
  2. Do a product import

Expected result

  1. A completed import where all the products are imported in Magento and not assigned to a category.

Actual result

  1. A failed import: [Warning: Undefined array key "NAMEOFCATEGORY" in /vendor/akeneo/module-magento2-connector-community/Job/Product.php on line 2972

Because of

https://github.com/akeneo/magento2-connector-community/blob/d6c0cbf0d309cbcf9ce25b407e8fadd41cd5751a/Job/Product.php#L2957-L2963

used in

https://github.com/akeneo/magento2-connector-community/blob/d6c0cbf0d309cbcf9ce25b407e8fadd41cd5751a/Job/Product.php#L2972

is empty since we don't import any categories from Akeneo.

pimruiter commented 1 year ago

I have the same issue on the same version. Instead of empty categories, I have an excluded Category tree in the Magento configuration.

In the code you supplied, the Akeneo connector is looking for excluded category codes.

stevelou2 commented 1 year ago

Same issue, any fixes ??