mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
adding empty data on CFChoice
And fixing a bug occuring because type of empty data are wrong. fix #23
This commit is contained in:
@@ -30,11 +30,13 @@ class ChoiceWithOtherType extends AbstractType
|
||||
$options['choices']['_other'] = $this->otherValueLabel;
|
||||
//ChoiceWithOther must always be expanded
|
||||
$options['expanded'] = true;
|
||||
// adding a default value for choice
|
||||
$options['empty_data'] = null;
|
||||
|
||||
$builder
|
||||
->add('_other', 'text', array('required' => false))
|
||||
->add('_choices', 'choice', $options)
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
/* (non-PHPdoc)
|
||||
@@ -45,7 +47,9 @@ class ChoiceWithOtherType extends AbstractType
|
||||
$resolver
|
||||
->setRequired(array('choices'))
|
||||
->setAllowedTypes(array('choices' => array('array')))
|
||||
->setDefaults(array('multiple' => false))
|
||||
->setDefaults(array(
|
||||
'multiple' => false,
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user