Skip to content

Commit 758a704

Browse files
committed
MERGE: Merge branch '3.3' into 4.0
2 parents e033102 + 364b160 commit 758a704

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Classes/Domain/Service/FakeNodeDataFactory.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
2020
use Neos\ContentRepository\Exception\NodeTypeNotFoundException;
2121
use Neos\Flow\Annotations as Flow;
22+
use Neos\Flow\Persistence\Doctrine\PersistenceManager;
2223

2324
/**
2425
* @Flow\Scope("singleton")
@@ -37,6 +38,12 @@ class FakeNodeDataFactory
3738
*/
3839
protected $nodeTypeManager;
3940

41+
/**
42+
* @var PersistenceManager
43+
* @Flow\Inject
44+
*/
45+
protected $persistenceManager;
46+
4047
/**
4148
* This creates a "fake" removed NodeData instance from the given payload
4249
*
@@ -76,6 +83,11 @@ public function createFromPayload(array $payload)
7683

7784
$nodeData->setRemoved(true);
7885

86+
// Ensure, the fake-node is not persisted
87+
if ($this->persistenceManager->isNewObject($nodeData)) {
88+
$this->persistenceManager->remove($nodeData);
89+
}
90+
7991
return $nodeData;
8092
}
8193
}

Classes/Indexer/NodeIndexer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
/**
2626
* NodeIndexer for use in batch jobs
27+
*
28+
* @Flow\Scope("singleton")
2729
*/
2830
class NodeIndexer extends ContentRepositoryAdaptor\Indexer\NodeIndexer
2931
{

0 commit comments

Comments
 (0)