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

Problem TranslatableEventSubscriber , event loadClassMetadata #729

Open
jbrat opened this issue Apr 5, 2023 · 1 comment
Open

Problem TranslatableEventSubscriber , event loadClassMetadata #729

jbrat opened this issue Apr 5, 2023 · 1 comment

Comments

@jbrat
Copy link

jbrat commented Apr 5, 2023

Hello,

I have a problem in my project in Symfony 5.4 with the TranslatableEventSubscriber

One of my entities "Page" isn't load in the loadClassMetadata event on the TranslatableEventSubscriber class, so it don't have the translations loaded by the metadata infos.

For example, if i debug all the classes which had been load in the TranslatableEventSubscriber (capture down), my class isn't displayed on the dump.

image

If i debug the class in the dispatchEvent function doLoadMetadata from the ClassMetadaFactory, my class is displayed
image

Someone have got any idea about the problem ?

If i create a custom PageEventSubscriber and implements the Events::loadClassMetadata, my entity is correctly display and i can override his metadata. So to fix the bug i just dupplicate the TranslatableEventSubscriber code in my PageEventSubscriber but it's not very clearly.

The header of my class :
image

Thank you for your futurs answers
Julien

@jbrat jbrat changed the title Problem TranslatableEventSubscriber , events loadClassMetadata Problem TranslatableEventSubscriber , event loadClassMetadata Apr 5, 2023
@hluchas
Copy link

hluchas commented Jul 25, 2023

I've the same problem

hluchas added a commit to hluchas/symfony-lts-playground that referenced this issue Jul 25, 2023
\Knp\DoctrineBehaviors\EventSubscriber\TranslatableEventSubscriber::loadClassMetadata() method is not called, subsriber is - same issue described here KnpLabs/DoctrineBehaviors#729
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

2 participants