Exercise/FOQElasticaBundle — Issue #64: postRemove event listener exception
Author: EmmanuelVella
Created: 2012-01-18 12:54:20+00:00
State: open

In the ORM postRemove event listener, the id of the entity is used to delete the corresponding record in elasticsearch. But at this moment, the id of the entity is no more available.

Indeed, when removing the entity, doctrine seems to set the id to null. See : https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L980

This leads to an exception in elastic search : https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Type.php#L209

In the log : ```at Elastica_Type ->deleteById (null) ```