Skip to content

Commit fe275f2

Browse files
committed
Fix (hack) regression ('query_builder not found') introduced by PR EasyCorp#3551
See EasyCorp#4229 : If the AssociationType is used with a FormType that doesn't have a query_builder option, Symfony will complain. As for now, it is just a hack, I suppose there may be a better way to do that. That's why I voluntarily kept the FQCN during the discussion.
1 parent bcc20b3 commit fe275f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Field/Configurator/AssociationConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
8484
->generateUrl();
8585

8686
$field->setFormTypeOption('attr.data-ea-autocomplete-endpoint-url', $autocompleteEndpointUrl);
87-
} else {
87+
} else if ($field->getFormType() instanceof \Symfony\Bridge\Doctrine\Form\Type) {
8888
$field->setFormTypeOptionIfNotSet('query_builder', static function (EntityRepository $repository) use ($field) {
8989
// TODO: should this use `createIndexQueryBuilder` instead, so we get the default ordering etc.?
9090
// it would then be identical to the one used in autocomplete action, but it is a bit complex getting it in here

0 commit comments

Comments
 (0)