Skip to content

Duplicate SKU possible if importing products #10080

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

Closed
pointia opened this issue Jun 28, 2017 · 4 comments
Closed

Duplicate SKU possible if importing products #10080

pointia opened this issue Jun 28, 2017 · 4 comments
Labels
bug report Component: ImportExport Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@pointia
Copy link

pointia commented Jun 28, 2017

It is possible in Magento to save a product with a sku that has a leading or trailing whitespace. This can lead to duplicate skus when you import products without the leading or trailing slash.

Preconditions

  1. Magento version 1.x and 2.x - the code is the same in both versions
  2. PHP 5.5 5.6 7.0 7.1
  3. MySql 5.5 5.6

Steps to reproduce

  1. First create a product in Magento Backend that has a trailing whitespace e.g. "SKU123 "
  2. If you try to create a product with the sku "SKU123" you will get an error which is correct
  3. Export de product data of the product with "SKU123 " and edit the file to remove the trailing whitespace
  4. Import the new product data with the sku "SKU123" and a new product in Magento will be imported
  5. Now we have 2 different products
  6. Now open the first product with the sku "SKU123 " and edit the sku and remove the trailing whitespace
  7. The product gets stored and now we have 2 products with the exact same sku - this is because the first product has a lower entity_id
  8. If you now try to store the second product with the higher SKU you will get an error that the SKU does already exist

Expected result

  • Import should trim whitespaces as uniuqe validator does OR
  • Unique validator should not allow to save the product with the lowest ID if the SKU is the same

Actual result

  • Import create 2 products
  • Validator only displays a unique notice at products with a higher entity_id
@koenner01
Copy link
Contributor

Probably related #8235

@OleksandrBurianyk
Copy link
Contributor

Thx for your reporting. We've created intenal ticket MAGETWO-70528

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 21, 2017
@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: ImportExport Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@pointia, thank you for your report.
We've created internal ticket(s) MAGETWO-70528 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@piotrekkaminski
Copy link
Contributor

This issue was moved to magento-engcom/import-export-improvements#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: ImportExport Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

6 participants