diff --git a/Form/Type/ChoiceWithOtherType.php b/Form/Type/ChoiceWithOtherType.php index b787ad4f6..ca57063d5 100644 --- a/Form/Type/ChoiceWithOtherType.php +++ b/Form/Type/ChoiceWithOtherType.php @@ -28,8 +28,10 @@ class ChoiceWithOtherType extends AbstractType */ public function buildForm(FormBuilderInterface $builder, array $options) { + + //$otherValueLabel = $options['other_value_label']; //add an 'other' entry in choices array - $options['choices']['_other'] = $this->otherValueLabel; + $options['choices'][$this->otherValueLabel] = '_other'; //ChoiceWithOther must always be expanded $options['expanded'] = true; // adding a default value for choice @@ -50,6 +52,7 @@ class ChoiceWithOtherType extends AbstractType $resolver ->setRequired(array('choices')) ->setAllowedTypes('choices', array('array')) + //->setDefault('other_value_label', null) ->setDefaults(array( 'multiple' => false, ))