mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +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
|
||||
$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()));
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user