Skip to content

Commit 2a33406

Browse files
authored
Merge pull request #5563 from dlubitz/bugfix/node-disable-at-end
BUGFIX: Disable nodes after processing all node variants for export
2 parents 9b6000c + 288b1c0 commit 2a33406

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Neos.ContentRepository.LegacyNodeMigration/Classes/Processors/EventExportProcessor.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ final class EventExportProcessor implements ProcessorInterface
6767
*/
6868
private array $nodeReferencesWereSetEvents = [];
6969

70+
/**
71+
* @var SubtreeWasTagged[]
72+
*/
73+
private array $subtreeWasTaggedEvents = [];
74+
7075
private int $numberOfExportedEvents = 0;
7176

7277
/**
@@ -107,6 +112,10 @@ public function run(ProcessingContext $context): void
107112
}
108113
$this->processNodeData($context, $nodeDataRow);
109114
}
115+
// Disable nodes, when the full import is done.
116+
foreach ($this->subtreeWasTaggedEvents as $subtreeWasTaggedEvent) {
117+
$this->exportEvent($subtreeWasTaggedEvent);
118+
}
110119
// Set References, now when the full import is done.
111120
foreach ($this->nodeReferencesWereSetEvents as $nodeReferencesWereSetEvent) {
112121
$this->exportEvent($nodeReferencesWereSetEvent);
@@ -274,7 +283,8 @@ public function processNodeDataWithoutFallbackToEmptyDimension(ProcessingContext
274283
}
275284
// nodes are hidden via SubtreeWasTagged event
276285
if ($this->isNodeHidden($nodeDataRow)) {
277-
$this->exportEvent(new SubtreeWasTagged($this->workspaceName, $this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()), NeosSubtreeTag::disabled()));
286+
// Put event at the end of the export, so variants created after this node are not disabled on variation
287+
$this->subtreeWasTaggedEvents[] = new SubtreeWasTagged($this->workspaceName, $this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()), NeosSubtreeTag::disabled());
278288
}
279289

280290
if (!$serializedPropertyValuesAndReferences->references->isEmpty()) {

0 commit comments

Comments
 (0)