From baf1cf88781b2b7f6f0626f8cae9d9756234cf5a Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Tue, 14 Oct 2025 09:43:48 +0200 Subject: [PATCH 1/2] New: Add signal after node is translated --- .../ContentRepository/NodeTranslationService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Classes/ContentRepository/NodeTranslationService.php b/Classes/ContentRepository/NodeTranslationService.php index ca0658b..fe1c77c 100644 --- a/Classes/ContentRepository/NodeTranslationService.php +++ b/Classes/ContentRepository/NodeTranslationService.php @@ -392,6 +392,7 @@ public function syncNode(NodeInterface $sourceNode, string $workspaceName = 'liv } $this->recursionPreventionEnabled = false; + $targetNodes = []; foreach ($this->contentDimensionConfiguration[$this->languageDimensionName]['presets'] as $presetIdentifier => $languagePreset) { if ($nodeSourceDimensionValue === $presetIdentifier) { continue; @@ -431,6 +432,7 @@ public function syncNode(NodeInterface $sourceNode, string $workspaceName = 'liv $context->getFirstLevelNodeCache()->flush(); $this->publishingService->publishNode($targetNode); + $targetNodes[] = $targetNode; } else { $removeContext = $this->getContextForLanguageDimensionAndWorkspaceName($presetIdentifier, $workspaceName); $targetNode = $removeContext->getNodeByIdentifier($sourceNode->getIdentifier()); @@ -439,10 +441,20 @@ public function syncNode(NodeInterface $sourceNode, string $workspaceName = 'liv } } } - + $this->emitAfterNodeTranslated($sourceNode, $targetNodes, $workspaceName); $this->recursionPreventionEnabled = true; } + /** + * Signals that a node has been translated + * + * @Flow\Signal + * @api + */ + public function emitAfterNodeTranslated(NodeInterface $sourceNode, array $targetNodes, string $workspaceName): void + { + } + /** * @return bool */ From 7f499c23dfe3e1897975da19d57bbaea68ee0b6e Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Tue, 14 Oct 2025 09:59:21 +0200 Subject: [PATCH 2/2] Update: Add doctype --- Classes/ContentRepository/NodeTranslationService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/ContentRepository/NodeTranslationService.php b/Classes/ContentRepository/NodeTranslationService.php index fe1c77c..5c13484 100644 --- a/Classes/ContentRepository/NodeTranslationService.php +++ b/Classes/ContentRepository/NodeTranslationService.php @@ -450,6 +450,10 @@ public function syncNode(NodeInterface $sourceNode, string $workspaceName = 'liv * * @Flow\Signal * @api + * @param NodeInterface $sourceNode + * @param NodeInterface[] $targetNodes + * @param string $workspaceName + * @return void */ public function emitAfterNodeTranslated(NodeInterface $sourceNode, array $targetNodes, string $workspaceName): void {