terminal42 / contao-mp_forms

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

Checkbox with Standard Option resets when going back steps #74

Open FlorinvV opened 1 year ago

FlorinvV commented 1 year ago

I noticed that a checkbox, which is declared as Standard-Option will always be active, as soon as I return to its step of the Form, even if it is deactivated in process.

The Value is saved correctly though, if I go through the form without retracing steps, it works fine.

Tested with: terminal42/contao-mp_forms 5.0.1 Contao 4.13.20

Toflar commented 10 months ago

Yes, this is something I unfortunately cannot fix. mp_forms works correctly, as far as I can tell. But the FormCheckbox widget of Contao does not. If you uncheck all options, the submitted value will be ''. And if you give it this value using $widget->value = '', it will render the defaults. So it does not make a difference between not set at all and no values selected.