From f3942835315b935a1191ebdc493e9fa14081f16e Mon Sep 17 00:00:00 2001 From: Tchama Date: Wed, 22 Jul 2020 17:05:24 +0200 Subject: [PATCH] fix sf4 deprecated: remove choices_as_values form option --- Export/Formatter/CSVFormatter.php | 2 -- Export/Formatter/CSVListFormatter.php | 1 - Export/Formatter/CSVPivotedListFormatter.php | 1 - Export/Formatter/SpreadSheetFormatter.php | 2 -- Export/Formatter/SpreadsheetListFormatter.php | 2 -- Form/Type/AppendScopeChoiceTypeTrait.php | 1 - Form/Type/ComposedRoleScopeType.php | 1 - Form/Type/DateIntervalType.php | 1 - Form/Type/Export/PickFormatterType.php | 1 - Form/Type/Select2ChoiceType.php | 1 - Form/UserType.php | 1 - 11 files changed, 14 deletions(-) diff --git a/Export/Formatter/CSVFormatter.php b/Export/Formatter/CSVFormatter.php index a270d8978..e77556a43 100644 --- a/Export/Formatter/CSVFormatter.php +++ b/Export/Formatter/CSVFormatter.php @@ -122,7 +122,6 @@ class CSVFormatter implements FormatterInterface range(1, $nbAggregators), range(1, $nbAggregators) ), - 'choices_as_values' => true, 'multiple' => false, 'expanded' => false )); @@ -132,7 +131,6 @@ class CSVFormatter implements FormatterInterface 'row' => 'r', 'column' => 'c' ), - 'choices_as_values' => true, 'multiple' => false, 'expanded' => false )); diff --git a/Export/Formatter/CSVListFormatter.php b/Export/Formatter/CSVListFormatter.php index a6981760a..b92ea78de 100644 --- a/Export/Formatter/CSVListFormatter.php +++ b/Export/Formatter/CSVListFormatter.php @@ -103,7 +103,6 @@ class CSVListFormatter implements FormatterInterface 'expanded' => true, 'multiple' => false, 'label' => "Add a number on first column", - 'choices_as_values' => true, 'data' => true )); } diff --git a/Export/Formatter/CSVPivotedListFormatter.php b/Export/Formatter/CSVPivotedListFormatter.php index c6a3f0971..d83193be5 100644 --- a/Export/Formatter/CSVPivotedListFormatter.php +++ b/Export/Formatter/CSVPivotedListFormatter.php @@ -102,7 +102,6 @@ class CSVPivotedListFormatter implements FormatterInterface 'expanded' => true, 'multiple' => false, 'label' => "Add a number on first column", - 'choices_as_values' => true, 'data' => true )); } diff --git a/Export/Formatter/SpreadSheetFormatter.php b/Export/Formatter/SpreadSheetFormatter.php index 7d5eb77aa..d14ecb9ad 100644 --- a/Export/Formatter/SpreadSheetFormatter.php +++ b/Export/Formatter/SpreadSheetFormatter.php @@ -160,7 +160,6 @@ class SpreadSheetFormatter implements FormatterInterface 'Microsoft Excel 2007-2013 XML (.xlsx) (Microsoft Excel, LibreOffice)' => 'xlsx', 'Comma separated values (.csv)' => 'csv' ), - 'choices_as_values' => true, 'placeholder' => 'Choose the format' )); @@ -194,7 +193,6 @@ class SpreadSheetFormatter implements FormatterInterface range(1, $nbAggregators), range(1, $nbAggregators) ), - 'choices_as_values' => true, 'multiple' => false, 'expanded' => false )); diff --git a/Export/Formatter/SpreadsheetListFormatter.php b/Export/Formatter/SpreadsheetListFormatter.php index 93ca1c08b..debc17de4 100644 --- a/Export/Formatter/SpreadsheetListFormatter.php +++ b/Export/Formatter/SpreadsheetListFormatter.php @@ -99,7 +99,6 @@ class SpreadsheetListFormatter implements FormatterInterface 'OpenDocument Format (.ods) (LibreOffice, ...)' => 'ods', 'Microsoft Excel 2007-2013 XML (.xlsx) (Microsoft Excel, LibreOffice)' => 'xlsx' ), - 'choices_as_values' => true, 'placeholder' => 'Choose the format' )) ->add('numerotation', ChoiceType::class, array( @@ -110,7 +109,6 @@ class SpreadsheetListFormatter implements FormatterInterface 'expanded' => true, 'multiple' => false, 'label' => "Add a number on first column", - 'choices_as_values' => true, 'data' => true )); } diff --git a/Form/Type/AppendScopeChoiceTypeTrait.php b/Form/Type/AppendScopeChoiceTypeTrait.php index 2cddce3cd..25d8fd0c4 100644 --- a/Form/Type/AppendScopeChoiceTypeTrait.php +++ b/Form/Type/AppendScopeChoiceTypeTrait.php @@ -122,7 +122,6 @@ trait AppendScopeChoiceTypeTrait $builder ->create($name, ChoiceType::class, array( 'choices' => array_combine(array_values($choices),array_keys($choices)), - 'choices_as_values' => true, 'auto_initialize' => false ) ) diff --git a/Form/Type/ComposedRoleScopeType.php b/Form/Type/ComposedRoleScopeType.php index e3554a126..c06394845 100644 --- a/Form/Type/ComposedRoleScopeType.php +++ b/Form/Type/ComposedRoleScopeType.php @@ -91,7 +91,6 @@ class ComposedRoleScopeType extends AbstractType $builder ->add('role', ChoiceType::class, array( '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)) { diff --git a/Form/Type/DateIntervalType.php b/Form/Type/DateIntervalType.php index c0fb741e8..5879bc525 100644 --- a/Form/Type/DateIntervalType.php +++ b/Form/Type/DateIntervalType.php @@ -72,7 +72,6 @@ class DateIntervalType extends AbstractType ]) ->add('unit', ChoiceType::class, [ 'choices' => $options['unit_choices'], - 'choices_as_values' => true ]) ; diff --git a/Form/Type/Export/PickFormatterType.php b/Form/Type/Export/PickFormatterType.php index aee1507f8..44726d915 100644 --- a/Form/Type/Export/PickFormatterType.php +++ b/Form/Type/Export/PickFormatterType.php @@ -55,7 +55,6 @@ class PickFormatterType extends AbstractType $builder->add('alias', ChoiceType::class, array( 'choices' => $choices, - 'choices_as_values' => true, 'multiple' => false, 'placeholder' => 'Choose a format' )); diff --git a/Form/Type/Select2ChoiceType.php b/Form/Type/Select2ChoiceType.php index f71638bb3..faadb3154 100644 --- a/Form/Type/Select2ChoiceType.php +++ b/Form/Type/Select2ChoiceType.php @@ -46,7 +46,6 @@ class Select2ChoiceType extends AbstractType $resolver->setDefaults( array( 'attr' => array('class' => 'select2 '), - 'choices_as_values' => true )); } } diff --git a/Form/UserType.php b/Form/UserType.php index 0b7c587d7..5196ee6c0 100644 --- a/Form/UserType.php +++ b/Form/UserType.php @@ -63,7 +63,6 @@ class UserType extends AbstractType ), 'expanded' => false, 'multiple' => false, - 'choices_as_values' => true // Can be removed when upgraded to Sf3. )) ); }