{"data":{"id":"magento2-39004","source":"github-pr","sourceRef":"magento/magento2#39004","title":"Ui Component File Field","pr":{"number":39004,"url":"https://github.com/magento/magento2/pull/39004","author":"Mohamed-Asar","mergedAt":"2025-01-07T15:54:40Z","mergeCommit":"d6856a5c3f0d24110716760e3ae72ef5069f7d3a","headCommit":"24f10d4304f218a8c3f852930c2d045fae8bf835","baseRef":"2.4-develop","diffSha256":"6199f7d1ee1cbac794a93847569a0ad4455397b644b10f26f3a9c5769358b0c4"},"issues":[{"number":38908,"url":"https://github.com/magento/magento2/issues/38908","title":"Ui Component File Field","labels":["Area: UI Framework","Component: UiComponents","Issue: Confirmed","Priority: P3","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x","Triage: Dev.Experience"],"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":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":"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-ui"],"files":[{"path":"app/code/Magento/Ui/view/base/web/js/form/element/media.js","change":"modified","package":"magento/module-ui"},{"path":"app/code/Magento/Ui/view/base/web/templates/form/element/media.html","change":"modified","package":"magento/module-ui"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":27,"mergeBatched":false,"excluded":null,"sections":{"description":"Even if we select a file, the validation fails, like no file was selected.\nh\n![346533395-e1667aa9-ca43-4516-8b18-53967a2fc682](https://github.com/magento/magento2/assets/20971693/fe04b194-d969-42de-8fc2-cfa475efffd1)","stepsToReproduce":"Add the following field in a ui component form:\n\n```xml\n<file name=\"file\">\n            <settings>\n                <label translate=\"true\">Select File to Import</label>\n                <dataScope>file</dataScope>\n                <validation>\n                    <rule name=\"required-entry\" xsi:type=\"boolean\">true</rule>\n                </validation>\n            </settings>\n        </file>\n```","expectedResult":"The form is submitted without error.","actualResult":"Even if we select a file, the validation fails, like no file was selected.\nh\n![346533395-e1667aa9-ca43-4516-8b18-53967a2fc682](https://github.com/magento/magento2/assets/20971693/fe04b194-d969-42de-8fc2-cfa475efffd1)","source":"issue"},"signatures":[],"labels":{"area":["UI Framework"],"component":["UiComponents"],"priority":"P3","severity":null,"reportedOn":["2.4.x"]},"categories":["Admin"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"6a97834fd22fd9893730f0c179106f0d4dd483b4b38a3be1c088f5172cbe762e","isBugfix":0.9785,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9626,"feature":0.0052,"refactor":0.01,"tests_only":0.0059,"docs_only":0.0031,"dependency":0.0035,"cleanup":0.0097},"confidence":0.9146},"scope":{"score":0.8563,"probabilities":{"0":0.2874,"1":0.5689,"2":0.1437},"confidence":0.1403},"risk":{"score":0.6185,"probabilities":{"0":0.4038,"1":0.5738,"2":0.0224},"confidence":0.2392},"area":{"choice":"admin","probabilities":{"catalog":0.0079,"checkout":0.0046,"customer":0.0042,"admin":0.7033,"graphql_api":0.0036,"framework":0.1622,"frontend":0.0961,"other":0.0181},"confidence":0.4636},"securityRelevant":0.0054,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0035,"2.4.0-p1":0.0034,"2.4.1":0.0034,"2.4.1-p1":0.0028,"2.4.2":0.0043,"2.4.2-p1":0.0041,"2.4.2-p2":0.0052,"2.4.3":0.007,"2.4.3-p1":0.0067,"2.4.3-p2":0.0083,"2.4.3-p3":0.0051,"2.4.4":0.0075,"2.4.4-p1":0.0056,"2.4.4-p10":0.0045,"2.4.4-p11":0.006,"2.4.4-p12":0.005,"2.4.4-p13":0.0051,"2.4.4-p14":0.0062,"2.4.4-p15":0.0045,"2.4.4-p16":0.0056,"2.4.4-p17":0.0049,"2.4.4-p18":0.0044,"2.4.4-p2":0.0023,"2.4.4-p3":0.003,"2.4.4-p4":0.0032,"2.4.4-p5":0.0035,"2.4.4-p6":0.0038,"2.4.4-p7":0.0038,"2.4.4-p8":0.0036,"2.4.4-p9":0.0033,"2.4.5":0.009,"2.4.5-p1":0.0088,"2.4.5-p10":0.0063,"2.4.5-p11":0.01,"2.4.5-p12":0.0081,"2.4.5-p13":0.0069,"2.4.5-p14":0.0077,"2.4.5-p15":0.0053,"2.4.5-p16":0.0064,"2.4.5-p17":0.0061,"2.4.5-p2":0.0033,"2.4.5-p3":0.0044,"2.4.5-p4":0.0055,"2.4.5-p5":0.0044,"2.4.5-p6":0.0047,"2.4.5-p7":0.0047,"2.4.5-p8":0.0047,"2.4.5-p9":0.0038,"2.4.6":0.02,"2.4.6-p1":0.016,"2.4.6-p10":0.0082,"2.4.6-p11":0.0115,"2.4.6-p12":0.0107,"2.4.6-p13":0.0096,"2.4.6-p14":0.009,"2.4.6-p15":0.0067,"2.4.6-p2":0.0039,"2.4.6-p3":0.0069,"2.4.6-p4":0.0077,"2.4.6-p5":0.0065,"2.4.6-p6":0.0071,"2.4.6-p7":0.0077,"2.4.6-p8":0.0054,"2.4.6-p9":0.0054,"2.4.7":0.0176,"2.4.7-p1":0.014,"2.4.7-p10":0.0088,"2.4.7-p2":0.0084,"2.4.7-p3":0.0117,"2.4.7-p4":0.0141,"2.4.7-p5":0.0126,"2.4.7-p6":0.0125,"2.4.7-p7":0.0123,"2.4.7-p8":0.0089,"2.4.7-p9":0.0066,"2.4.8":0.0191,"2.4.8-p1":0.0159,"2.4.8-p2":0.0144,"2.4.8-p3":0.0129,"2.4.8-p4":0.014,"2.4.8-p5":0.0124,"2.4.9":0.0145,"unspecified":0.3773},"confidence":0.1381},"backportWorthy":{"score":1.4847,"probabilities":{"0":0.1179,"1":0.2795,"2":0.6026},"confidence":0.1827}},"curated":{"title":"Fixes the issue where a required file field fails after a file is chosen","description":"A file field in a ui component form with the required-entry validation rule fails even if a file is selected, like no file was selected. The media element now sets its value when the file input changes, so the required field validation sees the selected file.","categories":["Admin"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-39004 details"}