Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@superhaggis

Description

@superhaggis
Issue body actions
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.