Skip to content
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

Product configuration creator does not warn about invalid SKUs #11953

Closed
JanisE opened this issue Nov 2, 2017 · 6 comments
Closed

Product configuration creator does not warn about invalid SKUs #11953

JanisE opened this issue Nov 2, 2017 · 6 comments
Assignees
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 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.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

@JanisE
Copy link
Contributor

JanisE commented Nov 2, 2017

Product configuration creator does not warn about invalid SKUs before attempting to save/create the configuration products, thus losing the product configurations set up.

Preconditions

  1. Magento CE 2.2.0 with sample data is installed by Composer.

Steps to reproduce

  1. In Admin go to Stores -> Attributes -> Product -> Add New Attribute
  2. Create an attribute with input type "Text Swatch" and values "Base" and "With Free Storage Kit" (sufficiently long).
  3. In Admin go to: Catalog -> Products -> Add Product
  4. Set name to "Sony Alpha a7R III Mirrorless Digital Camera (Body only)" e.i. something sufficiently long, near 64 characters, which is the limit for SKU field.
  5. Leave the SKU as automatically filled (the same as the name).
  6. (If you would append " (With Free Storage Kit)" to the name, the SKU field would appear red/invalid warning about the maximum length of 64 characters.)
  7. Save the product.
  8. Open that same product and click on "Create Configurations".
  9. Choose the attribute that was just created and "Next".
  10. Select both swatch values and "Next".
  11. Select whatever images, price, quantity and "Next".
  12. Click on "Generate Products".

Expected result

  1. There should be warnings about invalid (too long) SKUs.
  2. "Save" button would not work unless the (automatically generated from name + text swatch value) SKUs are edited to be valid (shortened).

Actual result

  1. There are no warnings about invalid SKUs.
  2. Clicking "Save" refreshes the page (losing the unsaved configurations).
  3. Error message 'Product with SKU " Sony Alpha a7R III Mirro -With Free Storage Kit-With Free Storage Kit" does not exist' is displayed.
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Nov 2, 2017
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 Nov 2, 2017
@zamoroka
Copy link
Member

#mageconf

zamoroka pushed a commit to zamoroka/magento2 that referenced this issue Dec 15, 2017
…lid SKUs

- Added validation for SKU field inside "Configurations" tab
zamoroka pushed a commit to zamoroka/magento2 that referenced this issue Dec 15, 2017
…lid SKUs

 - Make sku field as required
 - Length of sku gets from Sku model
zamoroka pushed a commit to zamoroka/magento2 that referenced this issue Dec 15, 2017
…lid SKUs

- Added validation for SKU field inside "Configurations" tab
zamoroka added a commit to zamoroka/magento2 that referenced this issue Dec 15, 2017
…lid SKUs

 - Make sku field as required
 - Length of sku gets from Sku model
@TomashKhamlai
Copy link
Contributor

Hello, @dmanners, I hope the comment here will save some time.
The actual behavior of the Magento application after the fix was applied is slightly different than desired expectations described in this ticket.

Here is what was done and what should be done according to the issue description:

  • There is no error because the product can't be saved
  • Unsaved configurations are not lost
  • There should be warnings about invalid (too long) SKUs after click on "Generate Products"

How it works now:

  1. In Admin go to Stores -> Attributes -> Product -> Add New Attribute
  2. Create an attribute with input type "Text Swatch" and values "Base" and "With Free Storage Kit" (sufficiently long)
  3. In Admin go to: Catalog -> Products -> Add Product
  4. Set name to "Sony Alpha a7R III Mirrorless Digital Camera (Body only)" e.i. something sufficiently long, near 64 characters, which is the limit for SKU field
  5. Leave the SKU as automatically filled (the same as the name)
  6. (If you would append " (With Free Storage Kit)" to the name, the SKU field would appear red/invalid warning about the maximum length of 64 characters)
  7. Save the product
  8. Open that same product and click on "Create Configurations"
  9. Choose the attribute that was just created and "Next"
  10. Select both swatch values and "Next"
  11. Select whatever images, price, quantity and "Next"
  12. Click on "Generate Products"
  13. Click on "Save"
  14. Choose an option from 'Choose Affected Attribute Set' popup and click 'Confirm'
  15. Close the popup if validation appeared and change it to be shorter then 64

Can we accept this as it removes errors and improves the user experience?

actual

@zamoroka
Copy link
Member

This validation was added trough to Magento way.
The same is already done for other fields, e.g. in price you can set -10$ and validation will proceed after "Save" button.
Also, your flow is not working if you put longer value to sku after "Create Configurations"

@okorshenko
Copy link
Contributor

Hi @JanisE. Thank you for your report.
The issue has been fixed in #12737 by @zamoroka in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Dec 22, 2017
@okorshenko
Copy link
Contributor

Hi @JanisE. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 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.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

5 participants