mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix deprecations: add choices_as_values=true + flip contents of choice in ChoiceType
This commit is contained in:
parent
fac8506893
commit
9cd32cb59c
@ -122,6 +122,7 @@ class CSVFormatter implements FormatterInterface
|
||||
range(1, $nbAggregators),
|
||||
range(1, $nbAggregators)
|
||||
),
|
||||
'choices_as_values' => true,
|
||||
'multiple' => false,
|
||||
'expanded' => false
|
||||
));
|
||||
|
@ -194,6 +194,7 @@ class SpreadSheetFormatter implements FormatterInterface
|
||||
range(1, $nbAggregators),
|
||||
range(1, $nbAggregators)
|
||||
),
|
||||
'choices_as_values' => true,
|
||||
'multiple' => false,
|
||||
'expanded' => false
|
||||
));
|
||||
|
@ -121,7 +121,8 @@ trait AppendScopeChoiceTypeTrait
|
||||
$form->add(
|
||||
$builder
|
||||
->create($name, ChoiceType::class, array(
|
||||
'choices' => $choices,
|
||||
'choices' => array_combine(array_values($choices),array_keys($choices)),
|
||||
'choices_as_values' => true,
|
||||
'auto_initialize' => false
|
||||
)
|
||||
)
|
||||
|
@ -90,7 +90,8 @@ class ComposedRoleScopeType extends AbstractType
|
||||
|
||||
$builder
|
||||
->add('role', ChoiceType::class, array(
|
||||
'choices' => $values,
|
||||
'choices' => array_combine(array_values($values),array_keys($values)),
|
||||
'choices_as_values' => true,
|
||||
'placeholder' => 'Choose amongst roles',
|
||||
'choice_attr' => function($role) use ($rolesWithoutScopes) {
|
||||
if (in_array($role, $rolesWithoutScopes)) {
|
||||
|
@ -54,7 +54,7 @@ class PickFormatterType extends AbstractType
|
||||
}
|
||||
|
||||
$builder->add('alias', ChoiceType::class, array(
|
||||
'choices' => $choices,
|
||||
'choices' => array_combine(array_values($choices),array_keys($choices)),
|
||||
'choices_as_values' => true,
|
||||
'multiple' => false
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user