akeneo / magento2-connector-community

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

No relation between configurables and children #655

Open Rocheauxfees opened 11 months ago

Rocheauxfees commented 11 months ago

Environment and configuration

  1. Magento Cloud v. 2.4.2-p1
  2. PHP v. 7.4
  3. MariaDB v. 10.3.35
  4. Akeneo-Connector v. 103.3.1
  5. Akeneo v. 5.0 CommunityEdition

Steps to reproduce

  1. Set configs in the admin panel for Akeneo Connector as shown in the screenshot (query to a single sku due to the non-ability of the connector to handle too much variants on the import by the whole family) image
  2. Start import via cli with the command php bin/magento akeneo_connector:import --code=product

Expected result

  1. Get the configurables imported with assigned children in it
  2. You can open a configurable product in the backend and the frontend

Actual result

  1. All products were transferred but without link between them
  2. If you open the detail view for a config in the admin there are no children shown to the user
  3. If you open the detail view for a simple in the admin it's functional completely
  4. The database table catalog_product_relation has no products if your filter for the row_id by a imported config
  5. The config product is reachable in the frontend, the simple not
  6. There is no error in any logs at all
Rocheauxfees commented 11 months ago

We found out what's going on here. It's related to the settings in the config view of the Akeneo Connector for the used version by Akeneo. But why?

The product.php has the following in the lines 2723 to 2736 if ($edition === Edition::SERENITY || $edition === Edition::GROWTH || $edition === Edition::SEVEN) { if (!empty($productModelItems) && array_key_exists($row['parent'], $productModelItems)) { $row['parent'] = $productModelItems[$row['parent']]; $connection->update( $tmpTable, [ 'parent' => $row['parent'], ], [ '_entity_id = ?' => $rowEntityId, ] ); } }

In version 103.3.1 (which we're using), but also in the current version 104.0.0

But why does it have the first if condition on this point? After moving our settings to pretend to have a growth edition (instead of the community edition we actually use) the linking of the products is back on working fine.