Skip to content
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

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

Closed
lucagtc opened this issue Jun 6, 2020 · 3 comments

Comments

@lucagtc
Copy link

lucagtc commented Jun 6, 2020

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';

@xabbuh
Copy link
Member

xabbuh commented Jun 7, 2020

Can you please check if #37085 fixes this?

@lucagtc
Copy link
Author

lucagtc commented Jun 8, 2020

Yes, this fix solve my problem.

Thank's

@xabbuh
Copy link
Member

xabbuh commented Jun 8, 2020

Thank you for the confirmation. Let's close here then.

@xabbuh xabbuh closed this as completed Jun 8, 2020
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

4 participants