Hi @manasbala,
After upgrading from Symfony 4.4 to 5.4 seems symfony/doctrine-bridge changed the LifecycleEventArgs namespace
from Doctrine\Common\Persistence\Event\LifecycleEventArgs
to Doctrine\ORM\Event\LifecycleEventArgs
The proposed change is in this file:
https://github.com/manasbala/doctrine-log-bundle/blob/master/src/EventListener/Logger.php#L5
to be:
use Doctrine\ORM\Event\LifecycleEventArgs;
To avoid the following error:
TypeError: Argument 1 passed to Mb\DoctrineLogBundle\EventListener\Logger::preRemove()
must be an instance of Doctrine\Common\Persistence\Event\LifecycleEventArgs,
instance of Doctrine\ORM\Event\LifecycleEventArgs given,
called in /var/www/vt/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php on line 68
BTW: I have temporarily fixed it using change suggested by overloading the original class with my class.
Just created the updated Logger.php file in app/resources/compat/DoctrineLogBundle/EventListener and updated composer.json.
"autoload-dev": {
"psr-4": {
"Mb\\DoctrineLogBundle\\EventListener\\": "app/resources/compat/DoctrineLogBundle/EventListener",
}
},
Thanks,
Daniel
Hi @manasbala,
After upgrading from Symfony 4.4 to 5.4 seems symfony/doctrine-bridge changed the LifecycleEventArgs namespace
from Doctrine\Common\Persistence\Event\LifecycleEventArgs
to Doctrine\ORM\Event\LifecycleEventArgs
The proposed change is in this file:
https://github.com/manasbala/doctrine-log-bundle/blob/master/src/EventListener/Logger.php#L5
to be:
use Doctrine\ORM\Event\LifecycleEventArgs;
To avoid the following error:
BTW: I have temporarily fixed it using change suggested by overloading the original class with my class.
Just created the updated Logger.php file in app/resources/compat/DoctrineLogBundle/EventListener and updated composer.json.
Thanks,
Daniel