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
@davisagli was fixing this bug plone/plone.org#139 in plone.org with plone/plone.org#145 and we discussed how a customization to FormValidation.js was made for plone.org to allow requiring boolean fields.
Making this change in Volto would probably break some things so should be reserved for a major version upgrade.
This is a placeholder for discussion.
The text was updated successfully, but these errors were encountered:
"required" for a boolean field means several different things in different places:
In Zope schemas, a Bool field with required=True means that the field must be set to a boolean value (True or False) rather than None.
In JSON-Schema (which the Zope schema gets serialized to in the REST API) in general, required is a list of property names that must be present in the object (whether or not they are set to a value).
But volto makes a stronger interpretation of required in the JSON schema, and checks to make sure that the required properties are not empty.
plone.org's customization goes a step further (too far IMO) and interprets a required boolean field as meaning that the value must be True.
I think volto's current implementation is good and matches the backend interpretation of required pretty well.
If plone.org needs to enforce that a boolean field is checked, it's probably better to do that with a validator instead of required=True. Then the customization wouldn't be needed.
@davisagli was fixing this bug plone/plone.org#139 in plone.org with plone/plone.org#145 and we discussed how a customization to FormValidation.js was made for plone.org to allow requiring boolean fields.
Making this change in Volto would probably break some things so should be reserved for a major version upgrade.
This is a placeholder for discussion.
The text was updated successfully, but these errors were encountered: