yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.64k stars 374 forks source link

yesod-form fileAFormReq not using required attribute in HTML #1779

Open tux314159 opened 2 years ago

tux314159 commented 2 years ago

Hi, I was using Yesod's applicative forms and I noticed that while areq produces an input element with required="", fileAFormReq does not, and so the form can be submitted without the file uploaded (which causes a server-side exception); I don't think this is the intended behaviour. I'm using yesod-core 1.6.24.0 and yesod-form 1.7.0 on GHC 9.0.2.

Thanks!

schoettl commented 2 years ago

Right, the required attribute should probably be merged into the fs parameter here: https://hackage.haskell.org/package/yesod-form-1.7.0/docs/src/Yesod.Form.Fields.html#fileAFormReq