Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296046

RecipeInputFormTrait forces you to check all checkboxes

$
0
0

Problem/Motivation

RecipeInputFormTrait, added by #3483435: Add a trait for forms that want to collect input on behalf of a recipe, marks all recipe input elements as required when it builds the form. This generally is correct because recipe inputs are never optional. But this is a problem for checkbox elements (single checkboxes, that is, not multi-value checkboxes) because they are always present in the submitted form data, but not required to be checked. The current code makes it impossible to leave a recipe input's checkbox unchecked.

Proposed resolution

Recipe input elements that have #type => checkbox should not get the #required flag by default.


Viewing all articles
Browse latest Browse all 296046


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>