fix deprecations: use choices_as_values=true and flip content of the choice options

This commit is contained in:
nobohan
2018-04-04 17:50:23 +02:00
parent 9951a5d765
commit 23dd4ec48b
6 changed files with 23 additions and 15 deletions

View File

@@ -111,8 +111,9 @@ class CustomFieldLongChoice extends AbstractCustomField
}
return $builder->add(self::KEY, ChoiceType::class, array(
'choices' => $choices,
'label' => 'Options key'
'choices' => array_combine(array_values($choices),array_keys($choices)),
'label' => 'Options key',
'choices_as_values' => true
));
}