terminal42 / contao-mp_forms

Real step separation in the form generator of the Contao Open Source CMS
25 stars 13 forks source link

Fix default field value #69

Closed wiphi closed 1 year ago

wiphi commented 1 year ago

Thanks for this cool extension for Contao. I found a little bug with default fields values.

If a form uses fields with default values set in the backend form generator, the default values get los. This PR checks if no post data is avaible and if the form fields has any default value instead to display.

Toflar commented 1 year ago

Hey, thanks for the contribution! I've simplified this a bit and adjusted the comments so I figured it would be easier if I did a commit directly myself :D Does that still work for you?

wiphi commented 1 year ago

Of course ;) I missed the optional parameter in getOriginalPostData()->get function. Your solution is quiet simpler. Thank you!

Toflar commented 1 year ago

Released as 5.0.1: https://github.com/terminal42/contao-mp_forms/releases/tag/5.0.1 Thanks for your contribution, Philipp!

wiphi commented 1 year ago

You're welcome 😁