EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
3.99k stars 1.01k forks source link

ChoiceField select html choices in CollectionField #6259

Open brunomartin opened 1 month ago

brunomartin commented 1 month ago

Describe the bug Explain what you wanted to do and the wrong result you got. When using ChoiceField in edit form, html select element choices are limited to the ones given a CrudController:

Capture d’écran 2024-04-14 à 22 25 13

When using the same in a CollectionField, the Tom Select clear-button element is available making possible to choose an empty choice:

Capture d’écran 2024-04-14 à 22 27 08

When choosing empty, this leads to following error:

Expected argument of type "string", "null" given at property path ...
Capture d’écran 2024-04-14 à 22 21 37

To Reproduce