I have installed FOSElasticaBundle to handle search and used the following configuration:
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
search:
client: default
types:
post:
mappings:
postTitle: ~
postContent: ~
persistence:
driver: orm
model: Shop\Bundle\ManagementBundle\Entity\Post
provider: ~
listener: ~
finder: ~
Search is working fine, but when I try to login a user, he is succesfully logged in but I get a redirection to login_check
route with the following error:
ContextErrorException: Catchable Fatal Error: Argument 1 passed to FOS\ElasticaBundle\Doctrine\Listener::postUpdate() must be an instance of Doctrine\Common\Persistence\Event\LifecycleEventArgs, instance of Doctrine\ORM\Event\LifecycleEventArgs given, called in C:\xampp\htdocs\community\vendor\symfony\symfony\src\Symfony\Bridge\Doctrine\ContainerAwareEventManager.php on line 63 and defined in C:\xampp\htdocs\community\vendor\friendsofsymfony\elastica-bundle\Doctrine\Listener.php line 111
If I am not wrong, the login_check
path is updating the record of the user (precisely the last_login_date field in user
table) which triggers the postUpdate()
lifecycle event. But I can't resolve the issue. Yout help is appreciated.
PS: I am using FOSUserBundle for users storage in database.
Edit: the above issue happens for other entities persistence lifecycle events (preRemove()...) as well.