-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Resource] Fixed issue with mapping inheritance and mapped superclass (Gedmo) #3627
Conversation
…es handled by ResourceBundle
…ProductTranslation
[Resource] Fixed issue with mapping inheritance and mapped superclass (Gedmo)
Thanks Kamil! |
@pamil sweet! I will definitely be checking this out once I get home. From taking a quick look, I can't seem to make sense of it easily. How does loading of the metadata when using cache get fixed by changing the priority of the event? |
@inssein SyliusResourceBundle does some really weird things with mapping (allowing mapped superclasses to have relationships and ids, etc.). As far as I know, it happened only while metadata cache was enabled and when the initial class metadata cache was created not in main application, but in some command (I'm not 100% sure here). Anyway, it resulted in the
This is the reason we had those problems with slugs and trees, but not with much more widely used timestampable and softdeletable behaviours. If you take a look at Gedmo's if ($meta->isMappedSuperclass) {
return; // ignore mappedSuperclasses for now
} So our mapped superclasses were transformed into entities just after the first two Gedmo listeners were called and their metadata was empty at that moment :) |
@inssein It depends on how your application looked like, with ResourceBundle listeners guaranteed to be on top, it should work everywhere :) |
ORM metadata caching did not contain empty data for the Gedmo (loggable) extension causing that some crucial informations were not logged (ie. changes in the Payment entity). Solution was ported from Sylius#3627, there you can find more information about the problem and the solution.
Probably fixes all bugs related to Gedmo DoctrineExtensions and mapping inheritance :)