Skip to content

Commit a1b9ca5

Browse files
authored
Merge pull request #13 from kdambekalns/bugfix/11-realtime-indexing
BUGFIX: Correctly handle realtime indexing of user workspaces
2 parents b8a81ed + 33b8adb commit a1b9ca5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Classes/Indexer/NodeIndexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NodeIndexer extends ContentRepositoryAdaptor\Indexer\NodeIndexer
3434

3535
/**
3636
* @param NodeInterface $node
37-
* @param string|null $targetWorkspaceName
37+
* @param string|null $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
3838
*/
3939
public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
4040
{

Classes/IndexingJob.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class IndexingJob implements JobInterface
5252
/**
5353
* @var string
5454
*/
55-
protected $workspaceName;
55+
protected $targetWorkspaceName;
5656

5757
/**
5858
* @var string
@@ -66,13 +66,13 @@ class IndexingJob implements JobInterface
6666

6767
/**
6868
* @param string $indexPostfix
69-
* @param string $workspaceName
69+
* @param string $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
7070
* @param array $nodes
7171
*/
72-
public function __construct($indexPostfix, $workspaceName, array $nodes)
72+
public function __construct($indexPostfix, $targetWorkspaceName, array $nodes)
7373
{
7474
$this->identifier = Algorithms::generateRandomString(24);
75-
$this->workspaceName = $workspaceName;
75+
$this->targetWorkspaceName = $targetWorkspaceName;
7676
$this->indexPostfix = $indexPostfix;
7777
$this->nodes = $nodes;
7878
}
@@ -94,7 +94,7 @@ public function execute(QueueInterface $queue, Message $message)
9494
/** @var NodeData $nodeData */
9595
$nodeData = $this->nodeDataRepository->findByIdentifier($node['nodeIdentifier']);
9696
$context = $this->contextFactory->create([
97-
'workspaceName' => $this->workspaceName,
97+
'workspaceName' => $this->targetWorkspaceName ?: $nodeData->getWorkspace()->getName(),
9898
'invisibleContentShown' => true,
9999
'inaccessibleContentShown' => false,
100100
'dimensions' => $node['dimensions']

0 commit comments

Comments
 (0)