Magento2: Product configuration creator does not warn about invalid SKUs

Created on 2 Nov 2017  路  6Comments  路  Source: magento/magento2

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.
Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

All 6 comments

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

mageconf

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:

  • [x] There is no error because the product can't be saved
  • [x] 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

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"

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

  • 5cf0d3480fcc302f922fce12a588afd5e5771491
  • 7418f1ac607c68003c2f4122f2b1bf07a35c044e

The fix will be available with the upcoming patch release.

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):

  • 54301a8ea63134b961d6b7b9891c31bc2798f8dc
  • 402b719168fc8b17ebc099c12b85f629cf90303b
  • 3837f2780b32112b7f70a9d3074158ee2336b1b7
  • 031e23e93ffaa258a39dfed5c5edb0e873ab0aa8
  • aa267f462f7eb964226a9c89d20c04b718406337
  • 934818dbee0bd36ec5eae7b3b7230c4d8a70b481
  • 6bed7d475bff5e98e27b8fdcaa998438bc31ed05
  • 72b2794043afd0012f9a8d5f6fc04df07acad3af
  • 4e64c415e26845826b527c17008eda00d3808591
  • d3feb280ed621c5ffe2dc3a2b7ac30abb25d9c22
  • 7aeccea46d2336a1322811a9d60d52432108c8e3
  • b857c022ae1cdb7975cf5c3d79cd679843c72a3b
  • a75bf2391dfc6e7c8a1283490f5de7551de42bbe
  • ab2e5798e529633f770c3970a0df999c11764e06
  • d904690443d43322c5dd2c58d075944eae867316
  • a821c7a3c17eb06983f421c47a7cc0fe99983a38
  • 68ac4c0bd6cae6b5b62e683c23f49293ee41d797
  • 93fe4d14faba635cc7c668b2d931e7595567cda9
  • f43fd4b98c55e1f498d060aeb245e4c969bdcb13
  • 2c52a8fd15cff7af7245573e2f26be6d601acb08

The fix will be available with the upcoming 2.3.0 release.

Was this page helpful?
0 / 5 - 0 ratings