magento2-connector-community
magento2-connector-community copied to clipboard
No relation between configurables and children
Environment and configuration
- Magento Cloud v. 2.4.2-p1
- PHP v. 7.4
- MariaDB v. 10.3.35
- Akeneo-Connector v. 103.3.1
- Akeneo v. 5.0 CommunityEdition
Steps to reproduce
- 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)
- Start import via cli with the command
php bin/magento akeneo_connector:import --code=product
Expected result
- Get the configurables imported with assigned children in it
- You can open a configurable product in the backend and the frontend
Actual result
- All products were transferred but without link between them
- If you open the detail view for a config in the admin there are no children shown to the user
- If you open the detail view for a simple in the admin it's functional completely
- The database table
catalog_product_relation
has no products if your filter for therow_id
by a imported config - The config product is reachable in the frontend, the simple not
- There is no error in any logs at all
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.