Skip to content

Commit 6bbf266

Browse files
committed
bug #3951 Don't override the query_builder form option in associations (javiereguiluz)
This PR was merged into the 3.0.x-dev branch. Discussion ---------- Don't override the query_builder form option in associations This is related to #3551, which we merged yesterday. One of my apps started failing because it used a custom `query_builder` form option. Commits ------- 3cc9c8a Don't override the query_builder form option in associations
2 parents ed8ae38 + 3cc9c8a commit 6bbf266

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
@@ -81,7 +81,7 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
8181

8282
$field->setFormTypeOption('attr.data-ea-autocomplete-endpoint-url', $autocompleteEndpointUrl);
8383
} else {
84-
$field->setFormTypeOption('query_builder', static function (EntityRepository $repository) use ($field) {
84+
$field->setFormTypeOptionIfNotSet('query_builder', static function (EntityRepository $repository) use ($field) {
8585
// TODO: should this use `createIndexQueryBuilder` instead, so we get the default ordering etc.?
8686
// it would then be identical to the one used in autocomplete action, but it is a bit complex getting it in here
8787
$queryBuilder = $repository->createQueryBuilder('entity');

0 commit comments

Comments
 (0)