8000 [Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 3.2.5 · Issue #21947 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 3.2.5 #21947

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
superhaggis opened this issue Mar 9, 2017 · 9 comments

Comments

@superhaggis
Copy link
superhaggis commented Mar 9, 2017
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.2.5

Assuming either #21656, #21267 or #21880 broke the expected behaviour of Doctrine Bridge's EntityType.

Assumptions:

  • You have an entity called AppBundle\Entity\Foo with correct annotations - fields: id, name
  • The database schema has been updated to reflect the entity
  • There is one row in the database table with ID 1
  • CSRF disabled for brevity

Use case:

  • Create a form called "bar", add an EntityType widget with the name "foo"; set "class" to "AppBundle:Foo"; set "choice_label" to "name"; set "multiple" to "true", set "invalid_message" to "Invalid value: {{ value }}".
  • Post the following data to the form: bar[foo][]=1
  • Evalulate $form->isValid()

Expected:

  • Evaluates to boolean true.

Actual:

  • Evalulates to boolean false - form errors state that for field "foo", the error is "Invalid value: array".

I rolled back to Symfony 3.2.4 and received the expected outcome of $form->isValid() evaluating to boolean true.

@xabbuh
Copy link
Member
xabbuh commented Mar 9, 2017

Support for Symfony 2.4 ended over two years ago (see http://symfony.com/roadmap?version=2.4#checker). None of the PRs that you are talking about was ever merged into the 2.4 branch. Are you sure that you are using that Symfony version?

@superhaggis
Copy link
Author

D'oh, I meant 3.4.5. Sorry, wrote that in a hurry. 👅

@superhaggis superhaggis changed the title [Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 2.4.5 [Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 3.4.5 Mar 9, 2017
@wouterj
Copy link
Member
wouterj commented Mar 9, 2017

Hmm, 3.4 isn't released yet. We're at 3.2 and 3.3-dev now. Given the PRs you referenced, I think you mean 3.2.4 and 3.2.5

@xabbuh
Copy link
Member
xabbuh commented Mar 9, 2017

@superhaggis Could you please fork the Symfony Standard Edition and make changes that allow to reproduce your issue?

@superhaggis superhaggis changed the title [Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 3.4.5 [Form]/[Doctrine][Bridge] EntityType broken for "multiple" under Symfony 3.2.5 Mar 9, 2017
@superhaggis
Copy link
Author

Doing too many things at once. 😢

Issue with 3.2.5 - sorry, I don't have time at the moment to fork to reproduce. Deadlines etc..

@yceruto
Copy link
Member
yceruto commented Mar 9, 2017

#21880 is about intl form types (not related to Doctrine Bridge's EntityType)

@yceruto
Copy link
Member
yceruto commented Mar 9, 2017

#21656 is about tests only (not related)

@mcfedr
Copy link
Contributor
mcfedr commented Mar 9, 2017

Seems to be the same as #21952

@yceruto
Copy link
Member
yceruto commented Mar 11, 2017

Confirmed! same as #21952 and fixed in #21957

@xabbuh xabbuh closed this as completed Mar 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0