Skip to content

[Form] [Validator] Form with ArrayAccess and field with property_path=>[key] broken #37125

@lucagtc

Description

@lucagtc

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy