[Form] Updated UPGRADE and CHANGELOG
This commit is contained in:
parent
bbffd1b00b
commit
081c6437e4
|
@ -480,6 +480,43 @@
|
||||||
));
|
));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* The "data_class" option now *must* be set if a form maps to an object. If
|
||||||
|
you leave it empty, the form will expect an array or a scalar value and
|
||||||
|
fail with a corresponding exception.
|
||||||
|
|
||||||
|
Likewise, if a form maps to an array, the option *must* be left empty now.
|
||||||
|
|
||||||
|
* The mapping of property paths to arrays has changed.
|
||||||
|
|
||||||
|
Previously, a property path "street" mapped to both a field `$street` of
|
||||||
|
a class (or its accessors `getStreet()` and `setStreet()`) and an index
|
||||||
|
`['street']` of an array or an object implementing `\ArrayAccess`.
|
||||||
|
|
||||||
|
Now, the property path "street" only maps to a class field (or accessors),
|
||||||
|
while the property path "[street]" only maps to indices.
|
||||||
|
|
||||||
|
If you defined property paths manually in the "property_path" option, you
|
||||||
|
should revise them and adjust them if necessary.
|
||||||
|
|
||||||
|
Before:
|
||||||
|
|
||||||
|
```
|
||||||
|
$builder->add('name', 'text', array(
|
||||||
|
'property_path' => 'address.street',
|
||||||
|
));
|
||||||
|
```
|
||||||
|
|
||||||
|
After (if the address object is an array):
|
||||||
|
|
||||||
|
```
|
||||||
|
$builder->add('name', 'text', array(
|
||||||
|
'property_path' => 'address[street]',
|
||||||
|
));
|
||||||
|
```
|
||||||
|
|
||||||
|
If address is an object in this case, the code given in "Before"
|
||||||
|
works without changes.
|
||||||
|
|
||||||
### Validator
|
### Validator
|
||||||
|
|
||||||
* The methods `setMessage()`, `getMessageTemplate()` and
|
* The methods `setMessage()`, `getMessageTemplate()` and
|
||||||
|
|
|
@ -71,3 +71,5 @@ CHANGELOG
|
||||||
* labels don't display field attributes anymore. Label attributes can be
|
* labels don't display field attributes anymore. Label attributes can be
|
||||||
passed in the "label_attr" option/variable
|
passed in the "label_attr" option/variable
|
||||||
* added option "mapped" which should be used instead of setting "property_path" to false
|
* added option "mapped" which should be used instead of setting "property_path" to false
|
||||||
|
* "data_class" now *must* be set if a form maps to an object and should be left empty otherwise
|
||||||
|
* improved error mapping on forms
|
||||||
|
|
Reference in New Issue