[Form] Fixed: set data is treated as string except if a transformer is set
This commit is contained in:
parent
cfaa03eeec
commit
4ec6ba8674
@ -255,13 +255,10 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
$this->dispatcher->dispatch(Events::filterSetData, $event);
|
$this->dispatcher->dispatch(Events::filterSetData, $event);
|
||||||
$appData = $event->getData();
|
$appData = $event->getData();
|
||||||
|
|
||||||
// Fix data if empty
|
|
||||||
if (!$this->clientTransformer) {
|
|
||||||
// Treat data as strings unless a value transformer exists
|
// Treat data as strings unless a value transformer exists
|
||||||
if (is_scalar($appData)) {
|
if (!$this->clientTransformer && !$this->normTransformer && is_scalar($appData)) {
|
||||||
$appData = (string)$appData;
|
$appData = (string)$appData;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Synchronize representations - must not change the content!
|
// Synchronize representations - must not change the content!
|
||||||
$normData = $this->appToNorm($appData);
|
$normData = $this->appToNorm($appData);
|
||||||
|
Reference in New Issue
Block a user