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] All index items after children are to be considered grand-children when resolving ViolationPath #11459

Merged
merged 1 commit into from
Sep 15, 2014

Conversation

FineWolf
Copy link
Contributor

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...

… grand-children when resolving ViolationPath (fixes #11458)
@FineWolf
Copy link
Contributor Author

Ping @webmozart

@gharlan
Copy link
Contributor

gharlan commented Jul 28, 2014

👍

@gharlan
Copy link
Contributor

gharlan commented Aug 5, 2014

Any news here?

@webmozart
Copy link
Contributor

Confirmed and merged. Thanks Andrew!

@webmozart webmozart merged commit c64a75f into symfony:2.3 Sep 15, 2014
webmozart added a commit that referenced this pull request Sep 15, 2014
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants