File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/Form/InfoProviderSystem Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 3030use Symfony \Component \Form \Extension \Core \Type \ChoiceType ;
3131use Symfony \Component \OptionsResolver \Options ;
3232use Symfony \Component \OptionsResolver \OptionsResolver ;
33+ use Symfony \Component \Translation \StaticMessage ;
3334
3435class ProviderSelectType extends AbstractType
3536{
@@ -70,7 +71,9 @@ public function configureOptions(OptionsResolver $resolver): void
7071 //The choice_label and choice_value only needs to be set if we want the objects
7172 $ resolver ->setDefault ('choice_label ' , function (Options $ options ){
7273 if ('object ' === $ options ['input ' ]) {
73- return ChoiceList::label ($ this , static fn (?InfoProviderInterface $ choice ) => $ choice ?->getProviderInfo()['name ' ]);
74+ return ChoiceList::label ($ this , static fn (?InfoProviderInterface $ choice ) => new StaticMessage ($ choice ?->getProviderInfo()['name ' ]));
75+ } else {
76+ return static fn ($ choice , $ key , $ value ) => new StaticMessage ($ key );
7477 }
7578
7679 return null ;
You can’t perform that action at this time.
0 commit comments