{"data":{"id":"magento2-36104","source":"github-pr","sourceRef":"magento/magento2#36104","title":"Category selection tree in edit product is not in the same order as set in Catalog->Categories","pr":{"number":36104,"url":"https://github.com/magento/magento2/pull/36104","author":"rogerdz","mergedAt":"2024-09-05T13:38:34Z","mergeCommit":"220e5a2c99e80220592f6f4165dcc6d255fd86fe","headCommit":"ab65056ef6a1ff833aa7720464ea12db9c9ed70b","baseRef":"2.4-develop","diffSha256":"54c5ee96399422d2b31e59bb9daf6095e75792fe1dd8812ab1be0c078f9e0f53"},"issues":[{"number":36101,"url":"https://github.com/magento/magento2/issues/36101","title":"Category selection tree in edit product is not in the same order as set in Catalog->Categories","labels":["Area: Catalog","Area: Product","Component: Catalog","Issue: Confirmed","Issue: ready for confirmation","Priority: P3","Progress: done","Reported on 2.4.5","Reproduced on 2.4.x"],"kind":"human"}],"fixedIn":"2.4.8","containingTags":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5","2.4.9"],"reportedOn":"2.4.5","codeMatch":{"2.4.6":"clean","2.4.6-p1":"clean","2.4.6-p2":"clean","2.4.6-p3":"clean","2.4.6-p4":"clean","2.4.6-p5":"clean","2.4.6-p6":"clean","2.4.6-p7":"clean","2.4.6-p8":"clean","2.4.6-p9":"clean","2.4.6-p10":"clean","2.4.6-p11":"clean","2.4.6-p12":"clean","2.4.6-p13":"clean","2.4.6-p14":"clean","2.4.6-p15":"clean","2.4.7":"clean","2.4.7-p1":"clean","2.4.7-p2":"clean","2.4.7-p3":"clean","2.4.7-p4":"clean","2.4.7-p5":"clean","2.4.7-p6":"clean","2.4.7-p7":"clean","2.4.7-p8":"clean","2.4.7-p9":"clean","2.4.7-p10":"clean","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":["2.4.6","2.4.6-p1","2.4.6-p2","2.4.6-p3","2.4.6-p4","2.4.6-p5","2.4.6-p6","2.4.6-p7","2.4.6-p8","2.4.6-p9","2.4.6-p10","2.4.6-p11","2.4.6-p12","2.4.6-p13","2.4.6-p14","2.4.6-p15","2.4.7","2.4.7-p1","2.4.7-p2","2.4.7-p3","2.4.7-p4","2.4.7-p5","2.4.7-p6","2.4.7-p7","2.4.7-p8","2.4.7-p9","2.4.7-p10"],"components":["magento/module-catalog"],"files":[{"path":"app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php","change":"modified","package":"magento/module-catalog"}],"stripped":{"tests":["app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php"],"docs":[],"outsideCode":[]},"linesChanged":16,"mergeBatched":false,"excluded":null,"sections":{"description":"The new category is at the bottom of the tree - suggesting the category tree under edit product is in creation order","stepsToReproduce":"1. Create a new category under Catalog->Categories\n2. Move the new category to the top of the tree\n3. Edit a product and click on the Categories select... drop down","expectedResult":"- New category should be at the top of the tree as per display order set in Catalog->Categories","actualResult":"The new category is at the bottom of the tree - suggesting the category tree under edit product is in creation order\n\nMakes administering  products difficult in large catalogues more difficult","source":"issue"},"signatures":[],"labels":{"area":["Catalog","Product"],"component":["Catalog"],"priority":"P3","severity":null,"reportedOn":["2.4.5"]},"categories":["Catalog/Product"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"58fec912fe0a0b29c96fd2c435a3b99bdab8645651920ef0403077f01b285fae","isBugfix":0.9763,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9644,"feature":0.0055,"refactor":0.0177,"tests_only":0.0064,"docs_only":0.0029,"dependency":0.0031},"confidence":0.9165},"scope":{"score":0.5918,"probabilities":{"0":0.4895,"1":0.4291,"2":0.0814},"confidence":0.1456},"risk":{"score":0.2912,"probabilities":{"0":0.738,"1":0.2328,"2":0.0292},"confidence":0.3996},"area":{"choice":"catalog","probabilities":{"catalog":0.7249,"checkout":0.0035,"customer":0.0026,"admin":0.2496,"graphql_api":0.003,"framework":0.0065,"frontend":0.006,"other":0.0039},"confidence":0.5291},"securityRelevant":0.005,"reportedVersion":{"choice":"2.4.5","probabilities":{"2.4.0":0.0021,"2.4.0-p1":0.0025,"2.4.1":0.0023,"2.4.1-p1":0.0021,"2.4.2":0.0031,"2.4.2-p1":0.0033,"2.4.2-p2":0.0041,"2.4.3":0.0049,"2.4.3-p1":0.0052,"2.4.3-p2":0.0073,"2.4.3-p3":0.0043,"2.4.4":0.0067,"2.4.4-p1":0.0055,"2.4.4-p10":0.0046,"2.4.4-p11":0.0044,"2.4.4-p12":0.0046,"2.4.4-p13":0.0044,"2.4.4-p14":0.0046,"2.4.4-p15":0.0049,"2.4.4-p16":0.0048,"2.4.4-p17":0.0037,"2.4.4-p18":0.0032,"2.4.4-p2":0.0018,"2.4.4-p3":0.002,"2.4.4-p4":0.0022,"2.4.4-p5":0.0032,"2.4.4-p6":0.003,"2.4.4-p7":0.0031,"2.4.4-p8":0.0036,"2.4.4-p9":0.0028,"2.4.5":0.3089,"2.4.5-p1":0.0205,"2.4.5-p10":0.0107,"2.4.5-p11":0.0173,"2.4.5-p12":0.0133,"2.4.5-p13":0.014,"2.4.5-p14":0.012,"2.4.5-p15":0.0125,"2.4.5-p16":0.0112,"2.4.5-p17":0.0122,"2.4.5-p2":0.0068,"2.4.5-p3":0.0104,"2.4.5-p4":0.0109,"2.4.5-p5":0.0102,"2.4.5-p6":0.0099,"2.4.5-p7":0.0093,"2.4.5-p8":0.0093,"2.4.5-p9":0.0066,"2.4.6":0.0136,"2.4.6-p1":0.0121,"2.4.6-p10":0.0069,"2.4.6-p11":0.0081,"2.4.6-p12":0.0068,"2.4.6-p13":0.0075,"2.4.6-p14":0.0065,"2.4.6-p15":0.0063,"2.4.6-p2":0.0038,"2.4.6-p3":0.0055,"2.4.6-p4":0.0062,"2.4.6-p5":0.0061,"2.4.6-p6":0.0067,"2.4.6-p7":0.006,"2.4.6-p8":0.0048,"2.4.6-p9":0.0036,"2.4.7":0.0077,"2.4.7-p1":0.0062,"2.4.7-p10":0.0047,"2.4.7-p2":0.0049,"2.4.7-p3":0.0071,"2.4.7-p4":0.0106,"2.4.7-p5":0.0076,"2.4.7-p6":0.0092,"2.4.7-p7":0.008,"2.4.7-p8":0.007,"2.4.7-p9":0.0038,"2.4.8":0.0072,"2.4.8-p1":0.0059,"2.4.8-p2":0.0069,"2.4.8-p3":0.0087,"2.4.8-p4":0.0089,"2.4.8-p5":0.0094,"2.4.9":0.0085,"unspecified":0.1369},"confidence":0.1083},"backportWorthy":{"score":1.3242,"probabilities":{"0":0.1953,"1":0.2853,"2":0.5194},"confidence":0.084}},"curated":{"title":"Fixes the product edit category tree not following the order set in Catalog","description":"The category selection tree in edit product is not in the same order as set in Catalog->Categories: a new category moved to the top of the tree is at the bottom, in creation order. The Categories form Modifier now adds addAttributeToSort by level and then position ASC to the category collection in retrieveCategoriesTree.","categories":["Catalog/Product"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":{"2.4.7-p10":{"before":"pass","after":"pass","adapted":false,"runAt":"2026-10-06T09:29:05.115Z","releaseCommit":"72561bf80652f57cc642a03e2c9a51d74a285b14","suites":{"unit":{"before":"pass","after":"pass","runAt":"2026-10-06T09:29:05.115Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-36104 details"}