KnpLabs / DoctrineBehaviors

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

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

Open bobvandevijver opened 2 weeks ago

bobvandevijver commented 2 weeks 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.