terminal42 / contao-conditionalformfields

Display form fields conditionally in Contao Open Source CMS
MIT License
18 stars 13 forks source link

Form field are not sent via email #80

Closed damxDESIGN closed 7 months ago

damxDESIGN commented 1 year ago

Contao 4.13.24 Conditional form field: 3.0.12

form setup: Checkbox menu with attribute "multiple" fieldset condition: checkbox_name == "some value"

expected: either not visible in front end due to variable type mismatch and not sent via email or visible in front end and sent via email

observed: fieldset visible in front end but form fields in said field set are not sent via email

this is kind of okay, but some hint or error message may prevent missing out on this and save you some time debugging. if you set fieldset condition to "in_array('value', checkbox_name)" then everything works perfectly fine.

aschempp commented 7 months ago

I have updated the script in 65c25c79fead99c2e523d44135a07a551f6086a0. You can no longer use foo == 2 to compare a checkbox array, but must use the in_array() method. This will make incorrect comparisons in the front end obvious because the fieldset will not be shown.