|
13 | 13 | use Flowpack\DecoupledContentStore\NodeRendering\Dto\NodeRenderingCompletionStatus; |
14 | 14 | use Flowpack\DecoupledContentStore\PrepareContentRelease\Infrastructure\RedisContentReleaseService; |
15 | 15 | use Flowpack\DecoupledContentStore\Utility\GeneratorUtility; |
| 16 | +use Neos\ContentRepository\Domain\Model\NodeInterface; |
16 | 17 | use Neos\ContentRepository\Domain\NodeType\NodeTypeConstraintFactory; |
17 | 18 | use Neos\ContentRepository\Domain\NodeType\NodeTypeName; |
| 19 | +use Neos\ContentRepository\Domain\Utility\NodePaths; |
| 20 | +use Neos\Eel\FlowQuery\FlowQuery; |
18 | 21 | use Neos\Flow\Annotations as Flow; |
19 | 22 | use Neos\Neos\Domain\Model\Site; |
20 | 23 |
|
@@ -91,10 +94,31 @@ private function enumerateAll(?Site $site, ContentReleaseLogger $contentReleaseL |
91 | 94 | 'dimensionValues' => $dimensionValues |
92 | 95 | ]); |
93 | 96 |
|
94 | | - foreach ($combinator->recurseDocumentChildNodes($siteNode) as $documentNode) { |
| 97 | + $documentQuery = new FlowQuery([$siteNode]); |
| 98 | + /** @var NodeInterface[] $documents */ |
| 99 | + $documents = $documentQuery->find('[instanceof Neos.Neos:Document]')->add($siteNode)->get(); |
| 100 | + |
| 101 | + foreach ($documents as $documentNode) { |
95 | 102 | $contextPath = $documentNode->getContextPath(); |
96 | 103 |
|
97 | | - if ($documentNode->isHidden()) { |
| 104 | + // Verify that the node is not orphaned |
| 105 | + $parentNode = $documentNode->getParent(); |
| 106 | + while ($parentNode !== $siteNode) { |
| 107 | + if ($parentNode === null) { |
| 108 | + $contentReleaseLogger->debug('Skipping node from publishing, because it is orphaned', [ |
| 109 | + 'node' => $contextPath, |
| 110 | + ]); |
| 111 | + // Continue with the next document |
| 112 | + continue 2; |
| 113 | + } |
| 114 | + $parentNode = $parentNode->getParent(); |
| 115 | + } |
| 116 | + |
| 117 | + if (!$documentNode->getParent()) { |
| 118 | + $contentReleaseLogger->debug('Skipping node from publishing, because it is orphaned', [ |
| 119 | + 'node' => $contextPath, |
| 120 | + ]); |
| 121 | + } else if ($documentNode->isHidden()) { |
98 | 122 | $contentReleaseLogger->debug('Skipping node from publishing, because it is hidden', [ |
99 | 123 | 'node' => $contextPath, |
100 | 124 | ]); |
|
0 commit comments