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