[Form/Translation] Could not use TranslatableInterface
as choice label
#46902
Labels
TranslatableInterface
as choice label
#46902
Symfony version(s) affected
6.0.8, 6.2 (as of 11.07.2022)
Description
Commit d5ce0e3 introduced
TranslatableInterface
contract, which could be used for custom translatable objects. As far as I understand this interface should be usable in every place, whereTranslatableMessage
could be used. This however is not the case, as it cannot be used for example as result fromchoice_label
function.How to reproduce
Create form with
ChoiceType
entry, that aschoice_label
returns some object implementingTranslatableInterface
.Possible Solution
In the Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php:178 we have:
Which should probably be
The same thing goes for
ChoiceView
class.Additional Context
No response
The text was updated successfully, but these errors were encountered: