xiidea / EasyAuditBundle

A Symfony Bundle To Log Selective Events
http://xiidea.github.io/EasyAuditBundle/
MIT License
89 stars 22 forks source link

Problem with DoctrineSubscriber delete event when using proxy classes #25

Closed Nils-1st-retail closed 6 years ago

Nils-1st-retail commented 6 years ago

Hello,

In you DoctrineSubscriber in the method "isConfiguredToTrack" you extract the class name with get_class.

If we delete from doctrine with a proxy class as in $em->remove($em->getReference("AppBundle:EntityName",$entityId)); The get_class will return the proxy class name for this Entity causing the "isConfigured" call to fail since the proxy class isn't configured.

I suggest to replace the "get_class" call on line 79 of DoctrineSubscriber with Doctrines class resolver \Doctrine\Common\Util\ClassUtils::getClass($entity); to get the correct class.

ronisaha commented 6 years ago

Thanks For this pointer. It's must be the issue #23 all about. I'll update the code whenever i could make time. A PR is also welcomed.

Thanks again

Nils-1st-retail commented 6 years ago

I have made a PR for the changes. You can look through it at any time.