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] [Validator] Form with ArrayAccess and field with property_path=>[key] broken #37125

Copy link
Copy link
Closed
@lucagtc

Description

@lucagtc
Issue body actions

Symfony version(s) affected: 4.4

Description
When form with object $data type ArrayAccess (example Doctrine ArrayCollection) is validate and the field use 'property_path' => '[key]', is generated wrong validation path -> [[key]].

How to reproduce
Create a form with data type ArrayCollection and add field with property_path => '[key]'. Then insert wrong value and validate.

Here a piece of wrong code (in my opinion)

$fieldPropertyPath = \is_object($data) ? 'children[%s]' : 'children%s';

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.