KnpLabs / DoctrineBehaviors

Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
http://knplabs.com
MIT License
916 stars 299 forks source link

Problem TranslatableEventSubscriber , event loadClassMetadata #729

Open jbrat opened 1 year ago

jbrat commented 1 year ago

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

hluchas commented 1 year ago

I've the same problem