Skip to content

Commit a462db9

Browse files
author
mczernik
committed
test if indexAllWorkspaces selected
1 parent abc8a4f commit a462db9

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Classes/Indexer/NodeIndexer.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
5656
return;
5757
}
5858

59+
if ($this->settings['indexAllWorkspaces'] === false) {
60+
if ($targetWorkspaceName !== null && $targetWorkspaceName !== 'live') {
61+
return;
62+
}
63+
64+
if ($targetWorkspaceName === null && $node->getContext()->getWorkspaceName() !== 'live') {
65+
return;
66+
}
67+
}
68+
5969
$indexingJob = new IndexingJob($this->indexNamePostfix, $targetWorkspaceName, $this->nodeAsArray($node));
6070
$this->jobManager->queue(NodeIndexQueueCommandController::LIVE_QUEUE_NAME, $indexingJob);
6171
}
@@ -72,6 +82,16 @@ public function removeNode(NodeInterface $node, $targetWorkspaceName = null)
7282
return;
7383
}
7484

85+
if ($this->settings['indexAllWorkspaces'] === false) {
86+
if ($targetWorkspaceName !== null && $targetWorkspaceName !== 'live') {
87+
return;
88+
}
89+
90+
if ($targetWorkspaceName === null && $node->getContext()->getWorkspaceName() !== 'live') {
91+
return;
92+
}
93+
}
94+
7595
$removalJob = new RemovalJob($this->indexNamePostfix, $targetWorkspaceName, $this->nodeAsArray($node));
7696
$this->jobManager->queue(NodeIndexQueueCommandController::LIVE_QUEUE_NAME, $removalJob);
7797
}

0 commit comments

Comments
 (0)