[Form] Fixed: set data is treated as string except if a transformer is set

This commit is contained in:
Bernhard Schussek 2011-03-27 23:09:46 +02:00
parent cfaa03eeec
commit 4ec6ba8674

View File

@ -255,13 +255,10 @@ class Form implements \IteratorAggregate, FormInterface
$this->dispatcher->dispatch(Events::filterSetData, $event);
$appData = $event->getData();
// Fix data if empty
if (!$this->clientTransformer) {
// Treat data as strings unless a value transformer exists
if (is_scalar($appData)) {
if (!$this->clientTransformer && !$this->normTransformer && is_scalar($appData)) {
$appData = (string)$appData;
}
}
// Synchronize representations - must not change the content!
$normData = $this->appToNorm($appData);