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

This commit is contained in:
nobohan 2018-04-04 17:54:17 +02:00
parent 95f32a8fcb
commit 4143e773b6
2 changed files with 72 additions and 70 deletions

View File

@ -99,6 +99,7 @@ class ListActivity implements ListInterface
'multiple' => true, 'multiple' => true,
'expanded' => true, 'expanded' => true,
'choices' => array_combine($this->fields, $this->fields), 'choices' => array_combine($this->fields, $this->fields),
'choices_as_values' => true,
'label' => 'Fields to include in export', 'label' => 'Fields to include in export',
'constraints' => [new Callback(array( 'constraints' => [new Callback(array(
'callback' => function($selected, ExecutionContextInterface $context) { 'callback' => function($selected, ExecutionContextInterface $context) {

View File

@ -102,9 +102,10 @@ class ActivityType extends AbstractType
->add('attendee', ChoiceType::class, array( ->add('attendee', ChoiceType::class, array(
'expanded' => true, 'expanded' => true,
'required' => false, 'required' => false,
'choices_as_values' => true,
'choices' => array( 'choices' => array(
true => 'present', 'present' => true,
false => 'not present' 'not present' => false
) )
)) ))
->add('user') ->add('user')