Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper methods for Translatable objects in filters #5822

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

Lustmored
Copy link
Contributor

This simple PR introduces support for translatable objects in a few places missed before - the filters:

  • A new setTranslatableChoices method is added to the ChoiceFilter and ArrayFilter, working exactly like the same method in ChoiceField,
  • Translatable objects are now allowed as arguments to NullFilter::setChoiceLabels method,
  • as an added value I have fixed two docblocks that allow TranslatableInterface, but weren't updated before.

I have tested those changes on my daily project and they work as expected. I see that tests for filters are verifying their filtering capabilities and not passing configuration, so I found no place to add tests for those changes.

@javiereguiluz javiereguiluz added this to the 4.x milestone Nov 27, 2023
@javiereguiluz
Copy link
Collaborator

I like this! I'm sorry it took us so long to merge it. Thanks Jakub.

@javiereguiluz javiereguiluz merged commit 12dad02 into EasyCorp:4.x Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants