{"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":"80581c3d79b9b62e9b0b7d4857cf8fd458937b4c1ba1080885e4005d237ad033","isBugfix":0.9783,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9709,"feature":0.0054,"refactor":0.0107,"tests_only":0.0058,"docs_only":0.0033,"dependency":0.0039},"confidence":0.9313},"scope":{"score":0.8394,"probabilities":{"0":0.2876,"1":0.5854,"2":0.127},"confidence":0.1623},"risk":{"score":0.6295,"probabilities":{"0":0.393,"1":0.5846,"2":0.0224},"confidence":0.2451},"area":{"choice":"admin","probabilities":{"catalog":0.0085,"checkout":0.0049,"customer":0.0045,"admin":0.7002,"graphql_api":0.0039,"framework":0.1632,"frontend":0.0973,"other":0.0175},"confidence":0.4592},"securityRelevant":0.0058,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0034,"2.4.0-p1":0.0036,"2.4.1":0.0033,"2.4.1-p1":0.0028,"2.4.2":0.004,"2.4.2-p1":0.0038,"2.4.2-p2":0.0049,"2.4.3":0.0067,"2.4.3-p1":0.0068,"2.4.3-p2":0.0077,"2.4.3-p3":0.0051,"2.4.4":0.0074,"2.4.4-p1":0.0055,"2.4.4-p10":0.0045,"2.4.4-p11":0.0056,"2.4.4-p12":0.005,"2.4.4-p13":0.0046,"2.4.4-p14":0.0057,"2.4.4-p15":0.0043,"2.4.4-p16":0.0054,"2.4.4-p17":0.0044,"2.4.4-p18":0.0036,"2.4.4-p2":0.0022,"2.4.4-p3":0.0028,"2.4.4-p4":0.003,"2.4.4-p5":0.0034,"2.4.4-p6":0.0037,"2.4.4-p7":0.0037,"2.4.4-p8":0.0035,"2.4.4-p9":0.0032,"2.4.5":0.0089,"2.4.5-p1":0.0084,"2.4.5-p10":0.0058,"2.4.5-p11":0.0086,"2.4.5-p12":0.0073,"2.4.5-p13":0.0064,"2.4.5-p14":0.0074,"2.4.5-p15":0.0051,"2.4.5-p16":0.0059,"2.4.5-p17":0.0056,"2.4.5-p2":0.003,"2.4.5-p3":0.004,"2.4.5-p4":0.0041,"2.4.5-p5":0.0044,"2.4.5-p6":0.0045,"2.4.5-p7":0.0043,"2.4.5-p8":0.0035,"2.4.5-p9":0.0036,"2.4.6":0.0224,"2.4.6-p1":0.0137,"2.4.6-p10":0.0077,"2.4.6-p11":0.0108,"2.4.6-p12":0.0083,"2.4.6-p13":0.0086,"2.4.6-p14":0.0075,"2.4.6-p15":0.006,"2.4.6-p2":0.0037,"2.4.6-p3":0.0062,"2.4.6-p4":0.007,"2.4.6-p5":0.0055,"2.4.6-p6":0.0065,"2.4.6-p7":0.0072,"2.4.6-p8":0.0055,"2.4.6-p9":0.0046,"2.4.7":0.016,"2.4.7-p1":0.014,"2.4.7-p10":0.0086,"2.4.7-p2":0.008,"2.4.7-p3":0.0103,"2.4.7-p4":0.0123,"2.4.7-p5":0.0106,"2.4.7-p6":0.011,"2.4.7-p7":0.0112,"2.4.7-p8":0.0085,"2.4.7-p9":0.0059,"2.4.8":0.0171,"2.4.8-p1":0.0152,"2.4.8-p2":0.0133,"2.4.8-p3":0.0118,"2.4.8-p4":0.0118,"2.4.8-p5":0.0103,"2.4.9":0.0129,"unspecified":0.4256},"confidence":0.1764},"backportWorthy":{"score":1.4879,"probabilities":{"0":0.1139,"1":0.2843,"2":0.6018},"confidence":0.184}},"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"}