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

Fix #766: Ensure translatable is loaded when local variables are accessed #767

Open bobvandevijver opened 5 months ago

bobvandevijver commented 5 months ago

The issue is that non-mapped properties ($currentLocale and $defaultLocale) are marked as excluded by the lazy ghost as they are not mapped. Hitting these properties therefor no longer triggers database hydration, which causes the load event handler to not be run for the translatable if it wasn't fully loaded. Calling the load manually will trigger hydration and the load event listener, initialising these properties correctly.