{"data":{"id":"magento2-40203","source":"github-pr","sourceRef":"magento/magento2#40203","title":"Fix error visiting compare page without items","pr":{"number":40203,"url":"https://github.com/magento/magento2/pull/40203","author":"indykoning","mergedAt":"2026-02-10T16:48:18Z","mergeCommit":"5078a6d03662324cbeb627c268ccf0c2e1371405","headCommit":"b5daa7f58fabf8cbd8a491514b10e9abed17febb","baseRef":"2.4-develop","diffSha256":"f691c7fc11d337a7c215da6b0d7c7fbbf720d65b0fb2a2798f8dc8fa7ac51776"},"issues":[{"number":40205,"url":"https://github.com/magento/magento2/issues/40205","title":"[Issue] Fix error visiting compare page without items","labels":["Area: Catalog","Component: Catalog","Issue: Confirmed","Priority: P2","Progress: PR Created","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"pr-derived"}],"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":"conflict","2.4.8-p1":"conflict","2.4.8-p2":"conflict","2.4.8-p3":"conflict","2.4.8-p4":"conflict","2.4.8-p5":"conflict","2.4.9":"conflict"},"affectedVersions":[],"components":["magento/module-catalog"],"files":[{"path":"app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php","change":"modified","package":"magento/module-catalog"}],"stripped":{"tests":["dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/CollectionTest.php"],"docs":[],"outsideCode":[]},"linesChanged":6,"mergeBatched":false,"excluded":null,"sections":{"description":"Going incognito and visiting `/catalog/product_compare/index/` will cause an\n```\nItem (Magento\\Catalog\\Model\\Product\\Interceptor) with the same ID \"xxx\" already exists.\n```","stepsToReproduce":"1. Ensure your `catalog_compare_items` somewhat matches the example above (duplicate product id's on different lists)\n2. Visit the `/catalog/product_compare/index/` route in incognito, so no visitor id, customer id, or list id is assigned to you\n3. See the error that occurs.","expectedResult":null,"actualResult":null,"source":"pr"},"signatures":["Error on many live webshops. This is because the database table looks somewhat like this"],"labels":{"area":["Catalog"],"component":["Catalog"],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":["Catalog/Product"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"a0f345ba400b35b289f938fb95909c83b62fd6addb9f7670dccc1f95a1793301","isBugfix":0.9813,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9749,"feature":0.0046,"refactor":0.0085,"tests_only":0.0071,"docs_only":0.0024,"dependency":0.0025},"confidence":0.9406},"scope":{"score":0.5466,"probabilities":{"0":0.5445,"1":0.3644,"2":0.0911},"confidence":0.1564},"risk":{"score":0.3168,"probabilities":{"0":0.7301,"1":0.223,"2":0.0469},"confidence":0.3775},"area":{"choice":"catalog","probabilities":{"catalog":0.8569,"checkout":0.0157,"customer":0.0206,"admin":0.016,"graphql_api":0.0304,"framework":0.015,"frontend":0.03,"other":0.0154},"confidence":0.7},"securityRelevant":0.0297,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0037,"2.4.0-p1":0.0031,"2.4.1":0.0035,"2.4.1-p1":0.003,"2.4.2":0.0059,"2.4.2-p1":0.0059,"2.4.2-p2":0.0067,"2.4.3":0.0084,"2.4.3-p1":0.01,"2.4.3-p2":0.0106,"2.4.3-p3":0.0062,"2.4.4":0.0133,"2.4.4-p1":0.0069,"2.4.4-p10":0.0056,"2.4.4-p11":0.0061,"2.4.4-p12":0.0051,"2.4.4-p13":0.0052,"2.4.4-p14":0.006,"2.4.4-p15":0.0043,"2.4.4-p16":0.0055,"2.4.4-p17":0.0045,"2.4.4-p18":0.0038,"2.4.4-p2":0.0021,"2.4.4-p3":0.0024,"2.4.4-p4":0.0028,"2.4.4-p5":0.003,"2.4.4-p6":0.0037,"2.4.4-p7":0.0038,"2.4.4-p8":0.0036,"2.4.4-p9":0.0032,"2.4.5":0.0138,"2.4.5-p1":0.0096,"2.4.5-p10":0.0061,"2.4.5-p11":0.0126,"2.4.5-p12":0.0083,"2.4.5-p13":0.0068,"2.4.5-p14":0.0087,"2.4.5-p15":0.0054,"2.4.5-p16":0.0065,"2.4.5-p17":0.0072,"2.4.5-p2":0.0028,"2.4.5-p3":0.0046,"2.4.5-p4":0.0045,"2.4.5-p5":0.0041,"2.4.5-p6":0.0048,"2.4.5-p7":0.0059,"2.4.5-p8":0.0043,"2.4.5-p9":0.0042,"2.4.6":0.0263,"2.4.6-p1":0.0161,"2.4.6-p10":0.0089,"2.4.6-p11":0.0122,"2.4.6-p12":0.0097,"2.4.6-p13":0.0097,"2.4.6-p14":0.0095,"2.4.6-p15":0.0082,"2.4.6-p2":0.0043,"2.4.6-p3":0.0084,"2.4.6-p4":0.0071,"2.4.6-p5":0.0067,"2.4.6-p6":0.0071,"2.4.6-p7":0.0057,"2.4.6-p8":0.005,"2.4.6-p9":0.0049,"2.4.7":0.0237,"2.4.7-p1":0.0146,"2.4.7-p10":0.0099,"2.4.7-p2":0.0077,"2.4.7-p3":0.013,"2.4.7-p4":0.0146,"2.4.7-p5":0.0114,"2.4.7-p6":0.0134,"2.4.7-p7":0.0121,"2.4.7-p8":0.0091,"2.4.7-p9":0.0064,"2.4.8":0.0212,"2.4.8-p1":0.018,"2.4.8-p2":0.0227,"2.4.8-p3":0.019,"2.4.8-p4":0.016,"2.4.8-p5":0.0149,"2.4.9":0.0225,"unspecified":0.3019},"confidence":0.0885},"backportWorthy":{"score":1.7574,"probabilities":{"0":0.0446,"1":0.1534,"2":0.802},"confidence":0.5031}},"curated":{"title":"Fixes the duplicate item error on the product compare page without a list","description":"Visiting /catalog/product_compare/index/ in incognito, with no visitor id, customer id or list id, will cause Item with the same ID already exists when duplicate product id's are on different lists. The query took items with visitor_id 0 and customer_id NULL from any list. Compare Item Collection::getConditionForJoin now also adds list_id null to the query.","categories":["Catalog/Product"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40203 details"}