Commit 97f09943 by Yvon

replace floats by string in choice value of two form fields so that data can be…

replace floats by string in choice value of two form fields so that data can be properly loaded and displayed
parent 190bbb42
...@@ -360,11 +360,12 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -360,11 +360,12 @@ class PrestataireAdmin extends AbstractAdmin
->with('Prestataire', ['class' => 'col-md-6']) ->with('Prestataire', ['class' => 'col-md-6'])
->add('conventionnement', ChoiceType::class, [ ->add('conventionnement', ChoiceType::class, [
'choices' => [ 'choices' => [
'50 %' => 0.5, '50 %' => '0.50', //using strings (and not floats) seems required
'75 %' => 0.75, '75 %' => '0.75', //to make display work fine
'100 %' => 1, '100 %' => '1.00',
], ],
'required' => false, 'required' => false,
'attr' => ['autocomplete' => 'off'] //avoid non-saved value to be displayed
]) ])
->end() ->end()
->end(); ->end();
......
...@@ -28,10 +28,12 @@ class DependentChildFormType extends AbstractType ...@@ -28,10 +28,12 @@ class DependentChildFormType extends AbstractType
'required' => true, 'required' => true,
'choices' => [ 'choices' => [
'non' => null, 'non' => null,
'oui : je le garde 25 % du temps' => 0.25, 'oui : je le garde 25 % du temps' => '0.25',//using strings as values (and not floats) seems required
'oui : je le garde 50 % du temps' => 0.50, 'oui : je le garde 50 % du temps' => '0.50',//to make display work fine
'oui : je le garde 75 % du temps' => 0.75, 'oui : je le garde 75 % du temps' => '0.75',
] ],
'required' => false,
'attr' => ['autocomplete' => 'off'] //avoid non-saved value to be displayed
]) ])
; ;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment