I have an application which has a base fieldset (Task) and collections (Roles) within that fieldset. I’ve setup validation to check the role collections are not empty but am struggling to get the system to validate the required field in the role collection.
I’ve tried adding a CollectionInputFilter to the base fieldset which does work and makes the field required in the collection however the validation always fails saying the field cannot be empty.
The CollectionInputFilter looks like this:
'type' => CollectionInputFilter::class,
'input_filter' => [
'IdRole' => [
'required' => true
]
]
The collection input filter is defined as this:
'claimTaskDefinitionResponsibleRoles' => [
'required' => true,
'validators' => [
[
'name' => NotEmpty::class,
'options' => array(
'messages' => array(
NotEmpty::IS_EMPTY => 'You must select at least 1 Role'
)
)
]
],
'type' => CollectionInputFilter::class,
'input_filter' => [
'IdRole' => [
'required' => true
]
]
],