@@ -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