Skip to content

[Forms] EntityType with multiple=true returns ArrayCollection but is documented to return array #16805

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

Closed
Xesau opened this issue May 16, 2022 · 1 comment
Labels
Form hasPR A Pull Request has already been submitted for this issue.

Comments

@Xesau
Copy link

Xesau commented May 16, 2022

In the documentation (https://symfony.com/doc/current/reference/forms/types/entity.html#multiple) it states that when multiple is enabled, the field should return an array. However, if you look at the tests (https://github.com/symfony/symfony/blob/6.1/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php) you see that it expects an ArrayCollection.

@xabbuh xabbuh added the Form label May 26, 2022
javiereguiluz added a commit that referenced this issue Oct 26, 2022
…Yamous)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Form] fix EntityType with multiple=true return type

Small fix for #16805 about return type in form with multiple option

I'm doing this on version 4.4 because it's the older maintained, but maybe we need to correct further?

Commits
-------

0ad2d2f [Form] fix EntityType with multiple=true return type
@javiereguiluz
Copy link
Member

Fixed in #16849.

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Form hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

No branches or pull requests

3 participants