Skip to content

Commit 5eabf7a

Browse files
committed
BUGFIX: Skip indexing if NodeData cannot be loaded
This fixes #14 by skipping indexing, but the fulltext index will still contain whatever content existed before the deletion.
1 parent 49f6498 commit 5eabf7a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • Classes/Flowpack/ElasticSearch/ContentRepositoryQueueIndexer

Classes/Flowpack/ElasticSearch/ContentRepositoryQueueIndexer/IndexingJob.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ public function execute(QueueInterface $queue, Message $message)
9292
foreach ($this->nodes as $node) {
9393
/** @var NodeData $nodeData */
9494
$nodeData = $this->nodeDataRepository->findByIdentifier($node['nodeIdentifier']);
95+
96+
// Skip this iteration if the nodedata can not be fetched (deleted node)
97+
if (!$nodeData instanceof NodeData) {
98+
$this->log(sprintf('action=indexing step=failed node=%s message="Node data could not be loaded"', $node['nodeIdentifier']));
99+
continue;
100+
}
101+
95102
$context = $this->contextFactory->create([
96103
'workspaceName' => $this->targetWorkspaceName ?: $nodeData->getWorkspace()->getName(),
97104
'invisibleContentShown' => true,

0 commit comments

Comments
 (0)