-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom import adapter data validation issue #19761
Comments
Hi @jaimin-ktpl. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @jaimin-ktpl do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets |
@jaimin-ktpl current fixes still don't provide complete backward compatibility with code designed for Magento 2.0.X, 2.1.X, 2.2.X.
Then 'sku' could be injected for all core import classes via di.xml. In _saveValidatedBunches() we could rename $skuSet into $uniqueFieldSet.
In case it is impossible to go with null as default value for $uniqueField, then we could set 'sku' there,
but then in custom code all developers would have to override that 'uniqueField' in di.xml to make custom import code operational again. Current fix Currently to make my code compatible with M 2.3 I had to move code of _saveValidatedBunches() from Magento 2.2 to my custom import model. With fixes, which we have now the problem is still not solved. |
Hi @jaimin-ktpl. Thank you for your report. The fix will be available with the upcoming 2.3.2 release. |
Hi @jaimin-ktpl. Thank you for your report. The fix will be available with the upcoming 2.2.10 release. |
Preconditions (*)
Steps to reproduce (*)
Magento\ImportExport\Model\Import\Entity\AbstractEntity
getValidColumnNames()
function.e.g. ['column1', 'column2', 'column3']
Expected result (*)
Actual result (*)
Notice: Undefined index: sku in /var/www/html/hamtc/vendor/magento/module-import-export/Model/Import/Entity/AbstractEntity.php on line 411
Other
I have checked and found that function
Magento\ImportExport\Model\Import\Entity\AbstractEntity::_saveValidatedBunches()
checks for row data validation and on line 411$skuSet[$rowData['sku']] = true;
code is added.It checks for
sku
column in CSV data which is not always there in every adapter.If I add dummy
sku
column and dummy sku data in my CSV, the file gets validated without errors.The text was updated successfully, but these errors were encountered: