-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use Autocomplete property as array on Master branche #6779
Comments
This is not really a bug since it was already a string on 3.x.
Did it work on 3.x for you with an array ? If yes, I recommend a PR on 3.x to
|
If you dont have a 3.x project, you can check it by removing the |
Indeed I'm also using this on my project (with 3.x) like $form
->add('account', ModelAutocompleteType::class, [
'property' => ['id', 'name'],
]) And in the docs listed on Symfony.com it actually also mentions this:
|
Can you open a PR on 3.x @dmaicher ? The construct should be
then, I think. And we should add a test. But I didn't find where the property was used... |
Wow! You guys are fast 👍 It is used in src/Action/RetrieveAutocompleteItemsAction.php on line 112 (were it's also tested as array). Thanks for all the work! |
Thanks to you for beta testing the master branch. We're trying hard to finish the 4.0 release. |
@willemverspyck this should work again on master. Can you confirm? |
Yes, it works. Thanks @dmaicher! |
Environment
Sonata packages
show
Symfony packages
show
PHP version
Subject
I'm already testing the master branche of Sonata with Symfony 5. Maybe the problem is already known, but when using this code:
With the "property" field as array, so that you can use multiple fields to search in, I get a Uncaught PHP Exception TypeError:
Because the parameter in the constructor expects "property" to be a string:
The text was updated successfully, but these errors were encountered: