mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
fix deprecations: use choices_as_values=true and flip content of the choice options
This commit is contained in:
parent
9951a5d765
commit
23dd4ec48b
@ -254,7 +254,8 @@ class CustomFieldsGroupController extends Controller
|
|||||||
'csrf_protection' => false
|
'csrf_protection' => false
|
||||||
))
|
))
|
||||||
->add('type', ChoiceType::class, array(
|
->add('type', ChoiceType::class, array(
|
||||||
'choices' => $fieldChoices
|
'choices' => array_combine(array_values($fieldChoices),array_keys($fieldChoices)),
|
||||||
|
'choices_as_values' => true
|
||||||
))
|
))
|
||||||
->add('customFieldsGroup', HiddenType::class)
|
->add('customFieldsGroup', HiddenType::class)
|
||||||
->add('submit', SubmitType::class);
|
->add('submit', SubmitType::class);
|
||||||
|
@ -124,8 +124,9 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
'1' => 'Multiple',
|
'Multiple' => '1',
|
||||||
'0' => 'Unique'),
|
'Unique' => '0'),
|
||||||
|
'choices_as_values' => true,
|
||||||
'empty_data' => '0',
|
'empty_data' => '0',
|
||||||
'label' => 'Multiplicity'
|
'label' => 'Multiplicity'
|
||||||
))
|
))
|
||||||
@ -133,16 +134,18 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
'1' => 'Expanded',
|
'Expanded' => '1',
|
||||||
'0' => 'Non expanded'),
|
'Non expanded' => '0'),
|
||||||
|
'choices_as_values' => true,
|
||||||
'empty_data' => '0',
|
'empty_data' => '0',
|
||||||
'label' => 'Choice display'
|
'label' => 'Choice display'
|
||||||
))
|
))
|
||||||
->add(self::ALLOW_OTHER, ChoiceType::class, array(
|
->add(self::ALLOW_OTHER, ChoiceType::class, array(
|
||||||
'label' => 'Allow other',
|
'label' => 'Allow other',
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
'0' => 'No',
|
'No' => '0',
|
||||||
'1' => 'Yes'),
|
'Yes' => '1'),
|
||||||
|
'choices_as_values' => true,
|
||||||
'empty_data' => '0',
|
'empty_data' => '0',
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false
|
'multiple' => false
|
||||||
|
@ -111,8 +111,9 @@ class CustomFieldLongChoice extends AbstractCustomField
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $builder->add(self::KEY, ChoiceType::class, array(
|
return $builder->add(self::KEY, ChoiceType::class, array(
|
||||||
'choices' => $choices,
|
'choices' => array_combine(array_values($choices),array_keys($choices)),
|
||||||
'label' => 'Options key'
|
'label' => 'Options key',
|
||||||
|
'choices_as_values' => true
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,9 +124,10 @@ class CustomFieldText extends AbstractCustomField
|
|||||||
->add(self::MAX_LENGTH, 'integer', array('empty_data' => 256))
|
->add(self::MAX_LENGTH, 'integer', array('empty_data' => 256))
|
||||||
->add(self::MULTIPLE_CF_INLINE, ChoiceType::class, array(
|
->add(self::MULTIPLE_CF_INLINE, ChoiceType::class, array(
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
'1' => 'Multiple boxes on the line',
|
'Multiple boxes on the line' => '1',
|
||||||
'0' => 'One box on the line'
|
'One box on the line' => '0'
|
||||||
),
|
),
|
||||||
|
'choices_as_values' => true,
|
||||||
'label' => 'Box appearance',
|
'label' => 'Box appearance',
|
||||||
'expanded' => True
|
'expanded' => True
|
||||||
))
|
))
|
||||||
|
@ -104,10 +104,11 @@ class CustomFieldTitle extends AbstractCustomField
|
|||||||
return $builder->add(self::TYPE, ChoiceType::class,
|
return $builder->add(self::TYPE, ChoiceType::class,
|
||||||
array(
|
array(
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
self::TYPE_TITLE => 'Main title',
|
'Main title' => self::TYPE_TITLE,
|
||||||
self::TYPE_SUBTITLE => 'Subtitle'
|
'Subtitle' => self::TYPE_SUBTITLE
|
||||||
),
|
),
|
||||||
'label' => 'Title level'
|
'label' => 'Title level',
|
||||||
|
'choices_as_values' => true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,8 @@ class CustomFieldsGroupType extends AbstractType
|
|||||||
$builder
|
$builder
|
||||||
->add('name', 'translatable_string')
|
->add('name', 'translatable_string')
|
||||||
->add('entity', ChoiceType::class, array(
|
->add('entity', ChoiceType::class, array(
|
||||||
'choices' => $entities
|
'choices' => array_combine(array_values($entities),array_keys($entities)),
|
||||||
|
'choices_as_values' => true
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user