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

Bug/Feature? Implement Proxy Objects in DoctrineSubscriber #23

Closed
MvanRietschoten opened this issue May 1, 2018 · 8 comments
Closed

Comments

@MvanRietschoten
Copy link

Hi,

As I use the Change Tracking Policy: Deferred Explicit I need to persist all of my objects if I want them to be saved.
But sometimes these objects are Proxy objects like Proxies_CG_\App\DemoAcmeBundle\Entity\User instead of the normal App\DemoAcmeBundle\Entity\User entity that is registered in the config under doctrine_entities. (A workaround is to add the proxy objects there for people finding this post, like this: Proxies\__CG__\App\DemoAcmeBundle\Entity\User: [updated,deleted])

However, I would suggest to add a check for proxy objects and check against the real object in this method: \Xiidea\EasyAuditBundle\Subscriber\DoctrineSubscriber::handleEvent

So... I can work around it, but a fix would be nice :) If I had time I would fix it myself ^^ Hope to help someone who also has the same issue with doctrine proxy objects.
Here are some tags people can find this tread on: Easy Audit Bundle Doctrine Events not fired, data or entity saved but listener not triggered.

@ronisaha
Copy link
Member

ronisaha commented May 2, 2018

Hi,

Could you please provide an example repo where you getting Proxy classes for DoctrineSubscriber. We should always get original class in listener unless you use Proxies_CG_\App\DemoAcmeBundle\Entity\User. I was unable to reproduce your use case. If you could create a repository with the bug(!), I can look into that.

Happy coding!

@pribeirojtm
Copy link

I had the exact same issue as @MvanRietschoten .
For now, I'm workarounding with "Proxies_CG_\App\DemoAcmeBundle\Entity\User: [updated,deleted]" configuration for each entity.

@ronisaha
Copy link
Member

Could anyone please host a sample project with that bug. I was unable to reproduce that! @MvanRietschoten , @pribeirojtm

@ronisaha
Copy link
Member

ronisaha commented Jun 18, 2018

@MvanRietschoten , @pribeirojtm could you guys check your code without Proxies_CG_\App\* configured with the latest code in master.

@pribeirojtm
Copy link

Hi @ronisaha and @MvanRietschoten . I still have the code with Proxies_CG_\App* in my config.yml. but my question is if this was solved. It is in the latests release tag? Can I use the latest tag instead the master branch now? :)
Thanks.

@pribeirojtm
Copy link

Hi @ronisaha and @MvanRietschoten . I still have the code with Proxies_CG_\App* in my config.yml. but my question is if this was solved. It is in the latests release tag? Can I use the latest tag instead the master branch now? :)
Thanks.

Do you have any news on this? Thanks

@ronisaha
Copy link
Member

Sorry for late response, I thought you already know this issue has been fixed from version 1.4.8 and current latest release tag is 1.4.9. You are good to go with latest release tag.
The master branch is preparing to drop support for php version as they will be reached to end of life.
php 5.6 & 7.0 http://php.net/supported-versions.php.

@pribeirojtm
Copy link

Thanks @ronisaha

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

3 participants