Skip to content

Commit

Permalink
hotfix: catch exception if no document-declaration was found in norma…
Browse files Browse the repository at this point in the history
…l entity
  • Loading branch information
floriansemm committed Nov 15, 2018
1 parent 49cb335 commit 633b91c
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Doctrine/ORM/Listener/EntityIndexerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,24 @@ private function emptyCollections($object)
*/
public function postFlush(PostFlushEventArgs $eventArgs)
{
foreach ($this->persistedEntities as $entity) {
$this->solr->addDocument($entity);
}
$this->persistedEntities = [];
try {

foreach ($this->deletedRootEntities as $entity) {
$this->solr->removeDocument($entity);
}
$this->deletedRootEntities = [];
foreach ($this->persistedEntities as $entity) {
$this->solr->addDocument($entity);
}
$this->persistedEntities = [];

foreach ($this->deletedNestedEntities as $entity) {
$this->solr->removeDocument($entity);
foreach ($this->deletedRootEntities as $entity) {
$this->solr->removeDocument($entity);
}
$this->deletedRootEntities = [];

foreach ($this->deletedNestedEntities as $entity) {
$this->solr->removeDocument($entity);
}
$this->deletedNestedEntities = [];
} catch (\Exception $e) {
$this->logger->debug($e->getMessage());
}
$this->deletedNestedEntities = [];
}
}

0 comments on commit 633b91c

Please sign in to comment.