-
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
Invalid SKU Handling for Linked Products in Magento #39329
Comments
Hi @Syamsg. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @Syamsg, Thanks for your reporting and collaboration. We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots. The system throws an error stating that the linked product SKU is invalid, preventing any changes to the product. Hence Confirming the issue. Thanks. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-13311 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
Preconditions and environment
Steps to reproduce
Create a New Product:
Edit an Existing Product:
Add the Product with SKU "0":
Save the Main Product:
Observe the Error:
Expected result
The system should allow the linking of the product with a SKU of "0" without throwing an error, or it should prevent saving a product with "0" as a SKU outright.
Actual result
The system throws an error stating that the linked product SKU is invalid, preventing any changes to the product.
Additional information
This issue arises in the file Magento\Catalog\Model\ProductLink\Repository, specifically in the public function save, where the following condition is used:
One approach to resolve this is by adding an explicit check for the SKU value to prevent saving it as "0." For instance, you could add a validation condition to prevent saving a SKU as "0" at the time of saving the product.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: