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

Join Translations on EntityFilterTypes #309

Open
mamazu opened this issue Jun 30, 2023 · 0 comments
Open

Join Translations on EntityFilterTypes #309

mamazu opened this issue Jun 30, 2023 · 0 comments

Comments

@mamazu
Copy link
Member

mamazu commented Jun 30, 2023

The current state

Currently if I want to use the EntityFilter with a translatable entity I would create a configuration like so:

        paymentMethod:
          type: 'entity'
          label: 'sylius.ui.payment_method'
          form_options:
            class: '%sylius.model.payment_method.class%'
            choice_label: translation

This will generate a filter for the Payment methods in my System. However, since the translations on those entity are lazy loaded, this means that if I have a couple of payment methods, it will lazy load the translations. This can be proven by not using a translatable attribute as a label but something like code.

Possible solutions

My idea would be to add a join in the QueryBuilder for the EntityType if the loaded entity implements the Sylius\Component\Resource\Model\TranslatableInterface. This however does not seem to have any effect on the loading of the label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant