You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
The issue remains the same now as it was in 2012: MultiCheckbox extends Checkbox. Checkbox's input filter defaults to required, a more or less sensible setup for an element that by default includes a hidden input so something should always be submitted. MultiCheckbox, sensibly, changes the default to not include the hidden input as it doesn't really make sense for a normal multi-checkbox setup. But, it doesn't override the input filter specification.
The result is that by default, a MultiCheckbox will throw a validation error when submitted with nothing checked.
The text was updated successfully, but these errors were encountered:
However we're changing the default behaviour of the element (form will now validate successfully when the checkbox name is not present in the form data, whereas previously it would not). There are likely form implementations that rely on the default behaviour being to require at least one selection so this is a BC break IMO.
My suggestion is we consider this a documentation issue rather than a bug. The default behaviour is fine as long as it's known and expected, and overriding it is straightforward (pull the form element's corresponding Input from the InputFilter and call setRequired(false)). Perhaps we just add a section to the MultiCheckbox documentation page with that information?
See zendframework/zendframework#4694, zendframework/zendframework#2395, https://framework.zend.com/issues/browse/ZF2-571.
The issue remains the same now as it was in 2012: MultiCheckbox extends Checkbox. Checkbox's input filter defaults to required, a more or less sensible setup for an element that by default includes a hidden input so something should always be submitted. MultiCheckbox, sensibly, changes the default to not include the hidden input as it doesn't really make sense for a normal multi-checkbox setup. But, it doesn't override the input filter specification.
The result is that by default, a MultiCheckbox will throw a validation error when submitted with nothing checked.
The text was updated successfully, but these errors were encountered: