renderAsEmbeddedForm is not validating subfields in PROD mode but does in dev mode
Describe the bug I can't explain why but when a AssociationField that has been rendered using renderAsEmbeddedForm the required field from the form are not shown in PROD environment, but are shown in DEV environment:
PROD mode (no required fields):
DEV mode (fields are required):
As you can see, my code is not that exotic:
Any idea about this, cab you reproduce it ?
Okay, I understood:
For some reason EA is not reading (or ignoring) Doctrine "nullable" flag while in prod mode. Required must be explicit + enforced with Symfony constraints.
That's... Weird ?...
I have the same issue and cannot fix it. The way with explicit required = true and constraints doesn't work for me
I have the same issue and cannot fix it. The way with explicit required = true and constraints doesn't work for me
Add a #[Assert\Valid] constrait on your OneToMany association :)