mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
fix deprecations: add choices_as_values=true + flip contents of choice in ChoiceType
This commit is contained in:
parent
3e9690f47e
commit
a35fd76053
@ -85,7 +85,8 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
//prepare $options
|
//prepare $options
|
||||||
$options = array(
|
$options = array(
|
||||||
'multiple' => $customFieldOptions[self::MULTIPLE],
|
'multiple' => $customFieldOptions[self::MULTIPLE],
|
||||||
'choices' => $choices,
|
'choices' => array_combine(array_values($choices),array_keys($choices)),
|
||||||
|
'choices_as_values' => true,
|
||||||
'required' => $customField->isRequired(),
|
'required' => $customField->isRequired(),
|
||||||
'label' => $this->translatableStringHelper->localize($customField->getName()));
|
'label' => $this->translatableStringHelper->localize($customField->getName()));
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class ChoiceWithOtherType extends AbstractType
|
|||||||
$options['expanded'] = true;
|
$options['expanded'] = true;
|
||||||
// adding a default value for choice
|
// adding a default value for choice
|
||||||
$options['empty_data'] = null;
|
$options['empty_data'] = null;
|
||||||
|
$options['choices_as_values'] = true;
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('_other', TextType::class, array('required' => false))
|
->add('_other', TextType::class, array('required' => false))
|
||||||
|
@ -110,6 +110,7 @@ class LinkedCustomFieldsType extends AbstractType
|
|||||||
|
|
||||||
$options = array_merge($this->options, array(
|
$options = array_merge($this->options, array(
|
||||||
'choice_list' => new SimpleChoiceList($choices),
|
'choice_list' => new SimpleChoiceList($choices),
|
||||||
|
'choices_as_values' => true
|
||||||
));
|
));
|
||||||
|
|
||||||
$event->getForm()->getParent()->add($this->choiceName, ChoiceType::class,
|
$event->getForm()->getParent()->add($this->choiceName, ChoiceType::class,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user