{"data":{"id":"magento2-40880","source":"github-pr","sourceRef":"magento/magento2#40880","title":"di.xml array item gets replaced if later config used numeric key","pr":{"number":40880,"url":"https://github.com/magento/magento2/pull/40880","author":"aasim110","mergedAt":"2026-08-14T09:28:44Z","mergeCommit":"6e6f5641867d480695c44211d558e7c78d801994","headCommit":"7ef87fb813c21e066a696c63d24f4a6bcd01bbe6","baseRef":"2.4-develop","diffSha256":"8b5698a8b16a8c2b8d034cca1771f0f4357279dccfd1de66e27e30605028b523"},"issues":[{"number":36861,"url":"https://github.com/magento/magento2/issues/36861","title":"di.xml array item gets replaced if later config used numeric key","labels":["Area: Framework","Issue: Confirmed","Priority: P2","Progress: PR Created","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"human"}],"fixedIn":null,"containingTags":[],"reportedOn":null,"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":"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":"clean"},"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","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"],"components":["magento/framework"],"files":[{"path":"lib/internal/Magento/Framework/Config/Dom.php","change":"modified","package":"magento/framework"}],"stripped":{"tests":["lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php","lib/internal/Magento/Framework/Config/Test/Unit/_files/dom/numeric_id_zero.xml","lib/internal/Magento/Framework/Config/Test/Unit/_files/dom/numeric_id_zero_merged.xml","lib/internal/Magento/Framework/Config/Test/Unit/_files/dom/numeric_id_zero_new.xml"],"docs":[],"outsideCode":[]},"linesChanged":2,"mergeBatched":false,"excluded":null,"sections":{"description":"DI contains only values from second module\n```\narray (\n    '_v_' =>\n        array (\n            0 => 'some_val_2',\n            'some_other_key' => 'some_val_3',\n        ),\n)\n```","stepsToReproduce":"1. Create moduł A with DI.xml\n```\n    <type name=\"Some\\Class\">\n        <arguments>\n            <argument name=\"someArgumentName\" xsi:type=\"array\">\n                <item name=\"some_key_1\" xsi:type=\"const\">some_val_1</item>\n            </argument>\n        </arguments>\n    </type>\n```\n2. Create module B with DI.xml\n```\n    <type name=\"Some\\Class\">\n        <arguments>\n            <argument name=\"someArgumentName\" xsi:type=\"array\">\n                <item name=\"0\" xsi:type=\"const\">some_val_2</item>\n                <item name=\"some_other_key\" xsi:type=\"const\">some_val_3</item>\n            </argument>\n        </arguments>\n    </type>\n```\n3. Compile di with `setup:di:compile`\n4. Check generated metadata `cat generated/metadata/graphql.php | grep \"someArgumentName\" -A 10`","expectedResult":"Generated DI must look contain all values. Smth like this\n```\narray (\n    '_v_' =>\n        array (\n            'some_key_1' => 'some_val_1',\n            0 => 'some_val_2',\n            'some_other_key' => 'some_val_3',\n        ),\n)\n```","actualResult":"DI contains only values from second module\n```\narray (\n    '_v_' =>\n        array (\n            0 => 'some_val_2',\n            'some_other_key' => 'some_val_3',\n        ),\n)\n```","source":"issue"},"signatures":[],"labels":{"area":["Framework"],"component":[],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"068b6f1184f96f8b13bfe8b150124b7e20a4e08fd1729e12dab7dc6bbf5e1be1","isBugfix":0.9802,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9634,"feature":0.0068,"refactor":0.0107,"tests_only":0.01,"docs_only":0.0037,"dependency":0.0054},"confidence":0.914},"scope":{"score":1.1471,"probabilities":{"0":0.2213,"1":0.4103,"2":0.3684},"confidence":0.0296},"risk":{"score":0.5868,"probabilities":{"0":0.5026,"1":0.408,"2":0.0894},"confidence":0.1406},"area":{"choice":"framework","probabilities":{"catalog":0.0029,"checkout":0.0024,"customer":0.002,"admin":0.0066,"graphql_api":0.0074,"framework":0.9725,"frontend":0.0032,"other":0.003},"confidence":0.9381},"securityRelevant":0.0056,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.005,"2.4.0-p1":0.0052,"2.4.1":0.0042,"2.4.1-p1":0.0037,"2.4.2":0.0052,"2.4.2-p1":0.0045,"2.4.2-p2":0.0058,"2.4.3":0.007,"2.4.3-p1":0.0075,"2.4.3-p2":0.0086,"2.4.3-p3":0.0056,"2.4.4":0.0098,"2.4.4-p1":0.0094,"2.4.4-p10":0.0053,"2.4.4-p11":0.0068,"2.4.4-p12":0.0054,"2.4.4-p13":0.0051,"2.4.4-p14":0.0063,"2.4.4-p15":0.0045,"2.4.4-p16":0.0055,"2.4.4-p17":0.0045,"2.4.4-p18":0.0041,"2.4.4-p2":0.0032,"2.4.4-p3":0.0036,"2.4.4-p4":0.0037,"2.4.4-p5":0.0043,"2.4.4-p6":0.0042,"2.4.4-p7":0.0041,"2.4.4-p8":0.0038,"2.4.4-p9":0.0037,"2.4.5":0.0101,"2.4.5-p1":0.0091,"2.4.5-p10":0.0057,"2.4.5-p11":0.0067,"2.4.5-p12":0.0058,"2.4.5-p13":0.0057,"2.4.5-p14":0.006,"2.4.5-p15":0.0044,"2.4.5-p16":0.005,"2.4.5-p17":0.0055,"2.4.5-p2":0.0034,"2.4.5-p3":0.0044,"2.4.5-p4":0.0048,"2.4.5-p5":0.0043,"2.4.5-p6":0.0047,"2.4.5-p7":0.0045,"2.4.5-p8":0.0041,"2.4.5-p9":0.0033,"2.4.6":0.0153,"2.4.6-p1":0.0114,"2.4.6-p10":0.0075,"2.4.6-p11":0.0073,"2.4.6-p12":0.0065,"2.4.6-p13":0.0059,"2.4.6-p14":0.0063,"2.4.6-p15":0.0051,"2.4.6-p2":0.004,"2.4.6-p3":0.0055,"2.4.6-p4":0.0059,"2.4.6-p5":0.0055,"2.4.6-p6":0.0055,"2.4.6-p7":0.0057,"2.4.6-p8":0.0042,"2.4.6-p9":0.0035,"2.4.7":0.0074,"2.4.7-p1":0.0082,"2.4.7-p10":0.0059,"2.4.7-p2":0.0059,"2.4.7-p3":0.0073,"2.4.7-p4":0.0093,"2.4.7-p5":0.0069,"2.4.7-p6":0.0091,"2.4.7-p7":0.007,"2.4.7-p8":0.005,"2.4.7-p9":0.0039,"2.4.8":0.0058,"2.4.8-p1":0.0066,"2.4.8-p2":0.0069,"2.4.8-p3":0.0059,"2.4.8-p4":0.0064,"2.4.8-p5":0.0057,"2.4.9":0.0064,"unspecified":0.5182},"confidence":0.2628},"backportWorthy":{"score":1.536,"probabilities":{"0":0.1014,"1":0.2613,"2":0.6373},"confidence":0.2271}},"curated":{"title":"Fixes di.xml array items being replaced when a later module uses the item name 0","description":"When a later di.xml config uses an item named 0 in an array argument, the items of other modules are silently dropped from the merged result. Config Dom treated the string 0 as falsy, so the XPath predicate was never appended. The fix uses a strict empty string check on the id attribute value.","categories":[],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":{"2.4.8-p5":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:20:34.149Z","releaseCommit":"870a22c63d9d9b68fa3297962e2d5d5841115814","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:20:34.149Z"}}},"2.4.9":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:20:33.597Z","releaseCommit":"755e34dd689021c5165db9d35ecff74f7dc51527","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:20:33.597Z"}}},"2.4.7-p10":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:29:34.966Z","releaseCommit":"72561bf80652f57cc642a03e2c9a51d74a285b14","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:29:34.966Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40880 details"}