-
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
Issue-39329-Invalid SKU Handling for Linked Products in Magento #39333
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @Syamsg. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
Is it really needed to prevent products with SKU "0" to be created? Also won't this cause issues for people who already have a product with SKU "0" that works fine, but when they want to update some value on it, your new code might prevent them doing so? Your other changes will solve the linking problem, so I don't think we should prevent SKU "0" from being created? Or are there other cases that go wrong with a product that has an SKU of "0"? |
I understand your point. Allowing SKU 0 is generally acceptable, as it’s unique, so only one product would have it. However, there could be potential issues since 0 may sometimes be interpreted as empty or false in programming contexts. Blocking 0 could also disrupt users who already use it. Unless we encounter specific issues in integrations, there’s no strong reason to prevent it, especially if other changes address linking concerns. Therefore, we don't necessarily need to prevent SKU 0, and I will add the required changes. |
Reverted the changes I made to restrict saving a product with SKU '0.' |
Description (*)
Invalid SKU Handling for Linked Products in Magento.
In Magento, it’s possible to save a product SKU as "0." However, an issue occurs when this product is added as a linked product (such as Related Products, Up-Sells, or Cross-Sells) to another product. When attempting to make changes to the main product, it triggers an error: "The linked product SKU is invalid. Verify the data and try again."
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Scenario : Save a Product with a Related Product Having SKU '0'
Set up Related Product with SKU '0':
'0'
.'0'
is valid for related products).Navigate to the Product to be Edited:
Add Related Product:
'0'
as a related product.Make an Edit to the Main Product:
Save the Product:
Expected Result:
'0'
should not prevent saving.'0'
remains correctly linked to the main product.Questions or comments
If a product with SKU 0 already exists, we should be able to add this product as a related product to other products.