Open LukaszZabielskiMonogo opened 3 years ago
Problem it was a Magento 2 B2B table structure, i make plugin and added necessary column to tmp_akeneo_connector_entities_category table. Next, modification is in vendor/akeneo/module-magento2-connector-community/Job/Category.php, method createEntities(). This line of code solved my issue $values['row_id'] = 'IFNULL (row_id, _entity_id)'; Now, I thinking how to override and fix this method without hard ovverides this class.
Hello, can I have more details on the resolution. I have the same issue. Thank you
@mhenni
`/**
@return array|null */ public function beforeCreateTmpTable( Entities $subject, array $fields, string $tableSuffix ): ?array { if ($tableSuffix == 'category') { if ($this->helperData->getCnfIsMagentoB2B()) { array_push( $fields, 'row_id' ); return [$fields, $tableSuffix]; } }
return null;
}`
`
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Magento 2 B2B Edition Compatibility</comment>
</field>
</group>`
<preference for="Akeneo\Connector\Job\Category" type="Vendor\VendorName\Job\Category" />
Override this function: public function createEntities() Add this line of code (original file line number 602):
if ($this->helperData->getCnfIsMagentoB2B()) { $values['row_id'] = 'IFNULL (row_id, _entity_id)'; }
Before:
/** @var \Magento\Framework\DB\Select $parents */ $parents = $connection->select()->from( $tmpTable, $values );
Hello, I rollback to version 101.6.1
and category import seems working to me on this version.
Hello @sad270 @mhenni @LukaszZabielskiMonogo ,
Thank you for reaching to us.
It seems that your issue is caused by the version 101.7.0 (https://github.com/akeneo/magento2-connector-community/releases/tag/v101.7.0) adding support for Magento 2 category staging, but we are unable to replicate the issue on our side with our settings.
Are you all using Magento 2 B2B modules?
@LukaszZabielskiMonogo : Problem it was a Magento 2 B2B table structure Do you have any details to help us resolve the issue? Did you find the root cause?
The "p.row_id" is supposed to be added in the select by the "addJoinForContentStagingCategory" function which is working well for us, so there must be a corner case that is currently not handled by the connector.
Many thanks.
Regards,
Environment and configuration
Steps to reproduce
Expected result
Actual result
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p.row_id' in 'field list', query was: INSERT INTO `catalog_category_entity` (`entity_id`, `attribute_set_id`, `parent_id`, `updated_at`, `path`, `position`, `level`, `children_count`, `row