Required fields don't work with useEntryCrudForm()
Describe the bug
Required fields don't work with useEntryCrudForm()
To Reproduce
// FooCrudController
TextField::new('code')->setRequired(true);
// SomeOtherCrudController
CollectionField::new('foos')->useEntryCrudForm();
leads to mysql error instead of warning in the UI like it does normally
Add it on main form too:
CollectionField::new('foos')->setRequired(true)->useEntryCrudForm();
@Geolim4 thx, now it works for me
Hello there :)
I jump into this thread cause I'm facing the same issue as @dwd-akira but the solution that you gave @Geolim4 doesn't suit my case.
Same example, but I don't want to force the user to add an entity in the 'foos' field. I want the 'code' field to be required ONLY when the user try to add an entity in the 'foos' field, without making this add mandatory.
I find strange that we need inheritance on the parent for the required attribute.
Any idea ?
@PGeekS put a @valid constraint on your relationship (ManyToMany or OneToMany) property.
This issue has been automatically closed as part of our end-of-year repository maintenance. As an open-source project with limited resources, we need to focus our efforts on the most current and impactful issues. If this feature or bug is still relevant to you, please create a new issue. For bugs, include a detailed reproducer, and for features, provide a clear explanation of your request. Thank you for your understanding and for supporting our project!