EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Autocomplete in collection field with useEntryCrudForm

Open cedriclombardot opened this issue 3 years ago • 0 comments

Describe the bug

When we try to implement a CollectionField :

CollectionField::new('items')
       ->setEntryIsComplex()
       ->useEntryCrudForm(ItemCrudController::class);

And in ItemCrudController::configureFields

 AssociationField::new('otherEntity')->autocomplete(),

we will get : Call to a member function getCustomOption() on null because in EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController::autocomplete() the

$field = FieldCollection::new($controller->configureFields($autocompleteContext['originatingPage']))->getByProperty($autocompleteContext['propertyName']); is null

Not found how to fix it ?!

cedriclombardot avatar Jun 27 '22 12:06 cedriclombardot