diff --git a/CustomFields/CustomFieldChoice.php b/CustomFields/CustomFieldChoice.php index 6738b32c8..81e57df87 100644 --- a/CustomFields/CustomFieldChoice.php +++ b/CustomFields/CustomFieldChoice.php @@ -85,7 +85,8 @@ class CustomFieldChoice extends AbstractCustomField //prepare $options $options = array( 'multiple' => $customFieldOptions[self::MULTIPLE], - 'choices' => $choices, + 'choices' => array_combine(array_values($choices),array_keys($choices)), + 'choices_as_values' => true, 'required' => $customField->isRequired(), 'label' => $this->translatableStringHelper->localize($customField->getName())); diff --git a/Form/Type/ChoiceWithOtherType.php b/Form/Type/ChoiceWithOtherType.php index 8f4b4b02c..beab31337 100644 --- a/Form/Type/ChoiceWithOtherType.php +++ b/Form/Type/ChoiceWithOtherType.php @@ -34,6 +34,7 @@ class ChoiceWithOtherType extends AbstractType $options['expanded'] = true; // adding a default value for choice $options['empty_data'] = null; + $options['choices_as_values'] = true; $builder ->add('_other', TextType::class, array('required' => false)) diff --git a/Form/Type/LinkedCustomFieldsType.php b/Form/Type/LinkedCustomFieldsType.php index 90b89bc1b..d14bb67ce 100644 --- a/Form/Type/LinkedCustomFieldsType.php +++ b/Form/Type/LinkedCustomFieldsType.php @@ -110,6 +110,7 @@ class LinkedCustomFieldsType extends AbstractType $options = array_merge($this->options, array( 'choice_list' => new SimpleChoiceList($choices), + 'choices_as_values' => true )); $event->getForm()->getParent()->add($this->choiceName, ChoiceType::class,