symfony/symfony — pull request #4341 by bschussek (2012-05-19 21:32:31+00:00)
Title: [Form] Improved the error mapping and made property paths deterministic

Bug fix: yes
Feature addition: no
Backwards compatibility break: **yes**
Symfony2 tests pass: yes
Fixes the following tickets: #3903
Todo:
* adapt CHANGELOG and UPGRADE
* test open issues (see below)

This PR is ready for review.

The algorithm for assigning errors to forms in the form tree was improved a lot. Also the error mapping works better now. There are still a few features to be added (e.g. wildcards "*"), but these can be implemented now pretty easily.

The following issues need to be verified whether they still apply with this PR:

* #1971
* #2945
* #3272
* #3995

Can anybody help with that?

This PR breaks PR in that a form explicitely needs to set the "data_class" option if it wants to map to an object and needs to leave that option empty if it wants to map to an array.

Furthermore, property paths must be deterministic now: "foo" now only maps to (g|s)etFoo(), but not the index ["foo"] (array or ArrayAccess), while "[foo]" only maps to the latter but not the former. See #3903 for more information.