Describe the bug
When you try to add a choice filter with translatableChoices using a Translatable Backed enum, the filter doesn't work.
To Reproduce
Try filtering a backed enum that implements TranslatableInterface like this:
public function configureFilters(Filters $filters): Filters
{
return $filters
->add(ChoiceFilter::new('subscriptionStatus', 'Status')->setTranslatableChoices(NotrufSubscriptionStatus::cases()));
}
(OPTIONAL) Additional context
The filter works if you use
public function configureFilters(Filters $filters): Filters
{
return $filters
->add(ChoiceFilter::new('subscriptionStatus', 'Status')->setChoices(NotrufSubscriptionStatus::cases()));
}
instead, but then you don't get the translated values anymore, you just get numbers.
Describe the bug
When you try to add a choice filter with translatableChoices using a Translatable Backed enum, the filter doesn't work.
To Reproduce
Try filtering a backed enum that implements TranslatableInterface like this:
(OPTIONAL) Additional context
The filter works if you use
instead, but then you don't get the translated values anymore, you just get numbers.