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
In laminas-form v3.9.0 some changes were made (#207) to ComposedObject. I believe this has caused Required(false) to now be ignored, meaning ComposedObjects are always checked, which breaks existing configuration.
Bug Report
Summary
In laminas-form v3.9.0 some changes were made (#207) to ComposedObject. I believe this has caused
Required(false)
to now be ignored, meaning ComposedObjects are always checked, which breaks existing configuration.Current behavior
If you annotate an element with
and then plug empty values into a form using laminas-form's
->setData([])
, then:->isValid()
returnsfalse
->getMessages()
returns['subForm' => ['name' => 'Value is required and can't be empty']]
How to reproduce
Full working example below. Uncomment the
'name' => 'test',
for the form to be valid, and run in 3.8.0 for it to work fine.Expected behavior
I expected the behavior in 3.8.0, that the entire object can be omitted if
@Form\Required(false)
is present.The text was updated successfully, but these errors were encountered: