{"data":{"id":"magento2-39333","source":"github-pr","sourceRef":"magento/magento2#39333","title":"Invalid SKU Handling for Linked Products in Magento","pr":{"number":39333,"url":"https://github.com/magento/magento2/pull/39333","author":"Syamsg","mergedAt":"2025-10-29T10:12:58Z","mergeCommit":"aa1a36fb07552a9d031324a06060a22aad292eb9","headCommit":"8cc35fd88e2bc0767daf131854be10da319c0d50","baseRef":"2.4-develop","diffSha256":"3c9a682581cbd837e37dafac99e4ab07a7f82a2cd6f585f7f2ac92186898911a"},"issues":[{"number":39329,"url":"https://github.com/magento/magento2/issues/39329","title":"Invalid SKU Handling for Linked Products in Magento","labels":["Area: Product","Component: UiComponents","Issue: Confirmed","Priority: P2","Progress: PR Created","Progress: PR in progress","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x"],"kind":"human"}],"fixedIn":"2.4.9","containingTags":["2.4.9"],"reportedOn":null,"codeMatch":{"2.4.6":"conflict","2.4.6-p1":"conflict","2.4.6-p2":"conflict","2.4.6-p3":"conflict","2.4.6-p4":"conflict","2.4.6-p5":"conflict","2.4.6-p6":"conflict","2.4.6-p7":"conflict","2.4.6-p8":"conflict","2.4.6-p9":"conflict","2.4.6-p10":"conflict","2.4.6-p11":"conflict","2.4.6-p12":"conflict","2.4.6-p13":"conflict","2.4.6-p14":"conflict","2.4.6-p15":"conflict","2.4.7":"conflict","2.4.7-p1":"conflict","2.4.7-p2":"conflict","2.4.7-p3":"conflict","2.4.7-p4":"conflict","2.4.7-p5":"conflict","2.4.7-p6":"conflict","2.4.7-p7":"conflict","2.4.7-p8":"conflict","2.4.7-p9":"conflict","2.4.7-p10":"conflict","2.4.8":"clean","2.4.8-p1":"clean","2.4.8-p2":"clean","2.4.8-p3":"clean","2.4.8-p4":"clean","2.4.8-p5":"clean","2.4.9":"conflict"},"affectedVersions":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5"],"components":["magento/module-catalog"],"files":[{"path":"app/code/Magento/Catalog/Model/ProductLink/Repository.php","change":"modified","package":"magento/module-catalog"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":2,"mergeBatched":false,"excluded":null,"sections":{"description":"The system throws an error stating that the linked product SKU is invalid, preventing any changes to the product.","stepsToReproduce":"1. **Create a New Product**:\n   - Navigate to **Catalog** > **Products**.\n   - Click on **Add Product**.\n   - Fill in the necessary details, and in the SKU field, enter **0**.\n   - Save the product.\n\n2. **Edit an Existing Product**:\n   - Go back to **Catalog** > **Products**.\n   - Choose any existing product you wish to link the previously created product to.\n   - Scroll down to the **Linked Products** section (Related Products, Up-Sells, or Cross-Sells).\n\n3. **Add the Product with SKU \"0\"**:\n   - In the linked products section, search for the product you created with the SKU of **0**.\n   - Add this product as a linked product.\n\n4. **Save the Main Product**:\n   - Click on **Save** to save the changes made to the main product.\n\n5. **Observe the Error**:\n   - After attempting to save, an error message will appear:  \"**The linked product SKU is invalid. Verify the data and try again.**\"\n![image](https://github.com/user-attachments/assets/676c19b7-83f2-4990-8ff1-7b0777fdb84d)\n\n![image](https://github.com/user-attachments/assets/12e4465a-02ee-439d-a6ff-39dbd04c784b)","expectedResult":"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.","actualResult":"The system throws an error stating that the linked product SKU is invalid, preventing any changes to the product.","source":"issue"},"signatures":["5. **Observe the Error**:","throw new NoSuchEntityException(__('The linked product SKU is invalid. Verify the data and try again.'));"],"labels":{"area":["Product"],"component":["UiComponents"],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":["Admin","Catalog/Product"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"874a430d161f0076af624969ff46318f8673aa7f751ec2a1a694d436d2c3e265","isBugfix":0.9801,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9711,"feature":0.0052,"refactor":0.0117,"tests_only":0.0047,"docs_only":0.0036,"dependency":0.0037},"confidence":0.9319},"scope":{"score":0.1914,"probabilities":{"0":0.8473,"1":0.1139,"2":0.0388},"confidence":0.5987},"risk":{"score":0.2956,"probabilities":{"0":0.7512,"1":0.202,"2":0.0468},"confidence":0.4109},"area":{"choice":"catalog","probabilities":{"catalog":0.873,"checkout":0.0086,"customer":0.005,"admin":0.0769,"graphql_api":0.0073,"framework":0.0121,"frontend":0.0079,"other":0.0092},"confidence":0.7353},"securityRelevant":0.006,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0074,"2.4.0-p1":0.0048,"2.4.1":0.0034,"2.4.1-p1":0.0031,"2.4.2":0.0041,"2.4.2-p1":0.0036,"2.4.2-p2":0.0047,"2.4.3":0.0065,"2.4.3-p1":0.0063,"2.4.3-p2":0.0075,"2.4.3-p3":0.0048,"2.4.4":0.0089,"2.4.4-p1":0.0064,"2.4.4-p10":0.0059,"2.4.4-p11":0.0065,"2.4.4-p12":0.0055,"2.4.4-p13":0.0053,"2.4.4-p14":0.0067,"2.4.4-p15":0.005,"2.4.4-p16":0.0059,"2.4.4-p17":0.0051,"2.4.4-p18":0.0043,"2.4.4-p2":0.0029,"2.4.4-p3":0.0032,"2.4.4-p4":0.0038,"2.4.4-p5":0.0035,"2.4.4-p6":0.0043,"2.4.4-p7":0.0043,"2.4.4-p8":0.004,"2.4.4-p9":0.0035,"2.4.5":0.0081,"2.4.5-p1":0.0063,"2.4.5-p10":0.0053,"2.4.5-p11":0.0087,"2.4.5-p12":0.0074,"2.4.5-p13":0.0064,"2.4.5-p14":0.0069,"2.4.5-p15":0.005,"2.4.5-p16":0.0063,"2.4.5-p17":0.0058,"2.4.5-p2":0.0031,"2.4.5-p3":0.004,"2.4.5-p4":0.0047,"2.4.5-p5":0.0038,"2.4.5-p6":0.0044,"2.4.5-p7":0.0043,"2.4.5-p8":0.0041,"2.4.5-p9":0.0031,"2.4.6":0.0168,"2.4.6-p1":0.0128,"2.4.6-p10":0.0074,"2.4.6-p11":0.0107,"2.4.6-p12":0.0092,"2.4.6-p13":0.0083,"2.4.6-p14":0.0087,"2.4.6-p15":0.0069,"2.4.6-p2":0.0044,"2.4.6-p3":0.006,"2.4.6-p4":0.0081,"2.4.6-p5":0.0061,"2.4.6-p6":0.0067,"2.4.6-p7":0.0068,"2.4.6-p8":0.0061,"2.4.6-p9":0.0045,"2.4.7":0.0165,"2.4.7-p1":0.0123,"2.4.7-p10":0.0086,"2.4.7-p2":0.0066,"2.4.7-p3":0.0096,"2.4.7-p4":0.013,"2.4.7-p5":0.0086,"2.4.7-p6":0.0128,"2.4.7-p7":0.0121,"2.4.7-p8":0.0081,"2.4.7-p9":0.0064,"2.4.8":0.0212,"2.4.8-p1":0.0176,"2.4.8-p2":0.0193,"2.4.8-p3":0.017,"2.4.8-p4":0.0165,"2.4.8-p5":0.0119,"2.4.9":0.0199,"unspecified":0.3836},"confidence":0.1429},"backportWorthy":{"score":1.6199,"probabilities":{"0":0.0673,"1":0.2454,"2":0.6873},"confidence":0.3056}},"curated":{"title":"Fixes the error when saving a product linked to a product with SKU 0","description":"Saving a product that has a product with SKU \"0\" as a related, up-sell or cross-sell linked product throws \"The linked product SKU is invalid. Verify the data and try again.\" The save function in Catalog ProductLink Repository now throws that error only when the linked product SKU is null or '', so a product with SKU \"0\" can be linked.","categories":["Catalog/Product","Admin"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-39333 details"}