Closed
Description
Given this simple form.
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('votes', 'text', array('empty_data' => 0))
;
}
If I leave the field votes
empty when I submit the form $form['votes']->getData()
gives me 0
If I change the field type to number
or integer
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('votes', 'number', array('empty_data' => 0))
;
}
$form['votes']->getData()
gives me null
Is this the correct behavior ? Is this related to #5906 ?