Skip to content

Commit

Permalink
Merge pull request #13 from kdambekalns/bugfix/11-realtime-indexing
Browse files Browse the repository at this point in the history
BUGFIX: Correctly handle realtime indexing of user workspaces
  • Loading branch information
dfeyer authored Jul 11, 2017
2 parents b8a81ed + 33b8adb commit a1b9ca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Classes/Indexer/NodeIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NodeIndexer extends ContentRepositoryAdaptor\Indexer\NodeIndexer

/**
* @param NodeInterface $node
* @param string|null $targetWorkspaceName
* @param string|null $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
*/
public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
{
Expand Down
10 changes: 5 additions & 5 deletions Classes/IndexingJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IndexingJob implements JobInterface
/**
* @var string
*/
protected $workspaceName;
protected $targetWorkspaceName;

/**
* @var string
Expand All @@ -66,13 +66,13 @@ class IndexingJob implements JobInterface

/**
* @param string $indexPostfix
* @param string $workspaceName
* @param string $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
* @param array $nodes
*/
public function __construct($indexPostfix, $workspaceName, array $nodes)
public function __construct($indexPostfix, $targetWorkspaceName, array $nodes)
{
$this->identifier = Algorithms::generateRandomString(24);
$this->workspaceName = $workspaceName;
$this->targetWorkspaceName = $targetWorkspaceName;
$this->indexPostfix = $indexPostfix;
$this->nodes = $nodes;
}
Expand All @@ -94,7 +94,7 @@ public function execute(QueueInterface $queue, Message $message)
/** @var NodeData $nodeData */
$nodeData = $this->nodeDataRepository->findByIdentifier($node['nodeIdentifier']);
$context = $this->contextFactory->create([
'workspaceName' => $this->workspaceName,
'workspaceName' => $this->targetWorkspaceName ?: $nodeData->getWorkspace()->getName(),
'invisibleContentShown' => true,
'inaccessibleContentShown' => false,
'dimensions' => $node['dimensions']
Expand Down

0 comments on commit a1b9ca5

Please sign in to comment.