Skip to content
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

LanguageField doesn't support multiple choices #6289

Open
Seb33300 opened this issue Apr 28, 2024 · 3 comments
Open

LanguageField doesn't support multiple choices #6289

Seb33300 opened this issue Apr 28, 2024 · 3 comments

Comments

@Seb33300
Copy link
Contributor

Describe the bug
LanguageField doesn't support allowMultipleChoices even when trying to enforce it with the native option:

->setFormTypeOption('multiple', true)

This results in an exception.

(OPTIONAL) Additional context
CountryField is very similar to LanguageField and supports the multiple option.

@emnsen
Copy link

emnsen commented May 6, 2024

Hey @Seb33300
Can you please elaborate a bit more? Version, exception, or the code you're trying etc..

I just tried and here is the result;

Code:
Screenshot 2024-05-06 at 16 08 20
Result:
Screenshot 2024-05-06 at 16 08 38

@Seb33300
Copy link
Contributor Author

Seb33300 commented May 6, 2024

Can you confirm the code property in your entity is an array?

Because when I try your code, I have this error:

EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\LanguageConfigurator::getLanguageName(): Argument #1 ($languageCode) must be of type string, array given, called in \vendor\easycorp\easyadmin-bundle\src\Field\Configurator\LanguageConfigurator.php on line 46

@emnsen
Copy link

emnsen commented May 6, 2024

Oh, yes, you're right. I hadn't tried changing the property type to an array. Now, I'm getting the same error as well. Sorry, my bad; I didn't check properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants