Skip to content

[Form] Validation not working when partial binding is enabled on submit() #9998

@Seb33300

Description

@Seb33300

Hello,

I am using the $clearMissing parameter on the $form->submit($request, $clearMissing) of one of my forms in order to not clear fields witch are not submitted in the request.
See : #7849

I am manually setting to my entity there missing fields values with PHP before passing it to my form type.

But a side effect of using $clearMissing is that fields witch are not submitted in the request are not validated by the $form->isValid() method.
Is it a bug ?
There is no reason to ignore there fields on the form validation.

I also discovered that setting error_bubbling option to true on there fields enable validation on them.

But i need errors to be attached to fileds, so i can't use error_bubbling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions