This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony
Bernhard Schussek ba218540b1 bug #11459 [Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath (Andrew Moore)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | unsure, see note below
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11458
| License       | MIT
| Doc PR        | -

#### Possible BC Break
The old behavior had unit test cases specifically testing the case of a grand-children form. However, this behavior is not documented anywhere and the fix seems to have no adverse effects on form validation. `Symfony\Component\Form\FormInterface` implements `ArrayAccess`, therefore, semantically speaking, `children[direct_child].children[grand_children]` and `children[direct_child][grand_children]` are equivalent. `offsetGet` is expected to fetch an element from `children`. I do not see why both were not considered equivalent when resolving the ViolationPath.

This commit will indeed change how some errors are mapped. However since the old mapping is (in my opinion) a bug...

Commits
-------

c64a75f [Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath (fixes #11458)
2014-09-15 19:17:27 +02:00
..
Bridge [SwiftmailerBridge] Bump allowed versions of swiftmailer 2014-09-10 18:06:23 +02:00
Bundle [FrameworkBundle] Remove invalid markup 2014-09-10 15:06:13 +02:00
Component bug #11459 [Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath (Andrew Moore) 2014-09-15 19:17:27 +02:00