Provided plone.formwidget.autocomplete.widget.AutocompleteMultiFieldWidget does fail to validate required field.
I wanted to create a RelationList field with at least one related item. Possible the easiest way to reproduce is to:
- Create a "dummy" Dexterity content type with
plone.app.relationfield.behavior.IRelatedItems behavior enabled.
- Go into
plone.app.relationfield.behavior.py and:
- do change
relatedItems field to required=True
- add widget
AutocompleteMultiFieldWidget in the schema to relatedItems field with plone.autoform.directives
What happens:
It is possible to create a new "dummy" content with no related items at all.
Expected behavior:
Not be able to create "dummy" unless there is at least one related items set.
Note:
Maybe the problem is much deeper, since I'm able to create the "dummy" without step 2. I'm also not getting validation error if I go TTW:
- Dexterity Content Types > Add new content type > "Fruits"
- Add new field > "Fruits" + MultiChoice + required checked
- "Fruits" settings > values: apples, oranges

- create a new "Fruits" with no fruits selected ...
Provided
plone.formwidget.autocomplete.widget.AutocompleteMultiFieldWidgetdoes fail to validate required field.I wanted to create a RelationList field with at least one related item. Possible the easiest way to reproduce is to:
plone.app.relationfield.behavior.IRelatedItemsbehavior enabled.plone.app.relationfield.behavior.pyand:relatedItemsfield torequired=TrueAutocompleteMultiFieldWidgetin the schema torelatedItemsfield withplone.autoform.directivesWhat happens:
It is possible to create a new "dummy" content with no related items at all.
Expected behavior:
Not be able to create "dummy" unless there is at least one related items set.
Note:
Maybe the problem is much deeper, since I'm able to create the "dummy" without step 2. I'm also not getting validation error if I go TTW: