fabrik
fabrik copied to clipboard
Hidden field element type integer does not store default value
I have an element Field 'lidnummer' set to;
Options Default: 0 Advanced Input type: number Formatting: Integer, 11 / 0
Depending on the input of a previous field,'lidnummer' is hidden or shown, If it is shown, 0 is displayed and it works.
If it is hidden, on submission an error is shown:
Incorrect integer value: '' for column prachta_dtc
.a_preregistered
.lidnummer
at row 1
This does not happen in J3/F3. There, if the field is hidden, 0 is written into the database. In the database, the colum 'lidnummer' is set by Fbrik to the type int(11).
This does not happen in J3/F3. With php7 or php8?
On the production J3/F3 site I run PHP 7.4.33 Even if the default value there is not set to 0, the element writes 0 in the database when hidden (and thus empty).
I 'solved' this for now by setting no default value, and in the form I use a PHP plugin that on BeforeProcess sets the 'lidnummer' field to zero, when it's empty.
But it is definitely a different behaviour from F3.
Is this still an issue with the latest version?
Yes, the issue is still present in version 4.0beta4b