66use Flowpack \JobQueue \Common \Job \JobInterface ;
77use Flowpack \JobQueue \Common \Queue \Message ;
88use Flowpack \JobQueue \Common \Queue \QueueInterface ;
9+ use Neos \ContentRepository \Domain \Model \NodeData ;
910use Neos \Flow \Annotations as Flow ;
1011use Neos \Flow \Log \SystemLoggerInterface ;
1112use Neos \Flow \Utility \Algorithms ;
@@ -52,7 +53,7 @@ class IndexingJob implements JobInterface
5253 /**
5354 * @var string
5455 */
55- protected $ workspaceName ;
56+ protected $ targetWorkspaceName ;
5657
5758 /**
5859 * @var string
@@ -66,13 +67,13 @@ class IndexingJob implements JobInterface
6667
6768 /**
6869 * @param string $indexPostfix
69- * @param string $workspaceName
70+ * @param string $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
7071 * @param array $nodes
7172 */
72- public function __construct ($ indexPostfix , $ workspaceName , array $ nodes )
73+ public function __construct ($ indexPostfix , $ targetWorkspaceName , array $ nodes )
7374 {
7475 $ this ->identifier = Algorithms::generateRandomString (24 );
75- $ this ->workspaceName = $ workspaceName ;
76+ $ this ->targetWorkspaceName = $ targetWorkspaceName ;
7677 $ this ->indexPostfix = $ indexPostfix ;
7778 $ this ->nodes = $ nodes ;
7879 }
@@ -94,7 +95,7 @@ public function execute(QueueInterface $queue, Message $message)
9495 /** @var NodeData $nodeData */
9596 $ nodeData = $ this ->nodeDataRepository ->findByIdentifier ($ node ['nodeIdentifier ' ]);
9697 $ context = $ this ->contextFactory ->create ([
97- 'workspaceName ' => $ this ->workspaceName ,
98+ 'workspaceName ' => $ this ->targetWorkspaceName ,
9899 'invisibleContentShown ' => true ,
99100 'inaccessibleContentShown ' => false ,
100101 'dimensions ' => $ node ['dimensions ' ]
0 commit comments