open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
37 stars 26 forks source link

prefilled fields keep their type #4774

Closed LaurensBurger closed 1 month ago

LaurensBurger commented 1 month ago

Product versie / Product version

2.8.0

Customer reference

DH 708

Omschrijf het probleem / Describe the bug

context: House number field are actually textfields, because there is no prefill tab on the number fields.

When this text field is prefilled with a int, it also submits this as a int which causes issues with the jsonschema's: {"non_field_errors":["61 is not of type 'string'"]}

As a form designer i expect the data from this text field to be a string, regardless of what type the source data might be. This would otherwise be impossible to map in the v2 objecttype.

joeribekker commented 1 month ago

Sergei mentions that we should cast the prefill data to the proper datatype of the field. We could use the normalize function for this.