diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index dd9afe2dc83..40658a0c1e1 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -186,7 +186,6 @@ public function findNodeAggregateById( return $this->nodeFactory->mapNodeRowsToNodeAggregate( $this->fetchRows($queryBuilder), $this->workspaceName, - $this->contentStreamId, VisibilityConstraints::withoutRestrictions() ); } @@ -247,7 +246,6 @@ public function findParentNodeAggregateByChildOriginDimensionSpacePoint(NodeAggr return $this->nodeFactory->mapNodeRowsToNodeAggregate( $this->fetchRows($queryBuilder), $this->workspaceName, - $this->contentStreamId, VisibilityConstraints::withoutRestrictions() ); } @@ -334,7 +332,6 @@ private function mapQueryBuilderToNodeAggregate(QueryBuilder $queryBuilder): ?No return $this->nodeFactory->mapNodeRowsToNodeAggregate( $this->fetchRows($queryBuilder), $this->workspaceName, - $this->contentStreamId, VisibilityConstraints::withoutRestrictions() ); } @@ -348,7 +345,6 @@ private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): No return $this->nodeFactory->mapNodeRowsToNodeAggregates( $this->fetchRows($queryBuilder), $this->workspaceName, - $this->contentStreamId, VisibilityConstraints::withoutRestrictions() ); } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index fb67effe7f6..810a095069f 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -300,7 +300,6 @@ public function findSubtree(NodeAggregateId $entryNodeAggregateId, FindSubtreeFi $node = $this->nodeFactory->mapNodeRowToNode( $nodeData, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints ); @@ -333,7 +332,6 @@ public function findAncestorNodes(NodeAggregateId $entryNodeAggregateId, FindAnc return $this->nodeFactory->mapNodeRowsToNodes( $nodeRows, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints ); @@ -387,7 +385,6 @@ public function findClosestNode(NodeAggregateId $entryNodeAggregateId, FindClose return $this->nodeFactory->mapNodeRowsToNodes( $nodeRows, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints )->first(); @@ -407,7 +404,6 @@ public function findDescendantNodes(NodeAggregateId $entryNodeAggregateId, FindD return $this->nodeFactory->mapNodeRowsToNodes( $nodeRows, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints ); @@ -679,7 +675,6 @@ private function fetchNode(QueryBuilder $queryBuilder): ?Node return $this->nodeFactory->mapNodeRowToNode( $nodeRow, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints ); @@ -695,7 +690,6 @@ private function fetchNodes(QueryBuilder $queryBuilder): Nodes return $this->nodeFactory->mapNodeRowsToNodes( $nodeRows, $this->workspaceName, - $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints ); @@ -717,7 +711,12 @@ private function fetchReferences(QueryBuilder $queryBuilder): References } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch references: %s', $e->getMessage()), 1678364944, $e); } - return $this->nodeFactory->mapReferenceRowsToReferences($referenceRows, $this->workspaceName, $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints); + return $this->nodeFactory->mapReferenceRowsToReferences( + $referenceRows, + $this->workspaceName, + $this->dimensionSpacePoint, + $this->visibilityConstraints + ); } /** diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php index b040311e07c..9398adbb688 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php @@ -64,7 +64,6 @@ public function __construct( public function mapNodeRowToNode( array $nodeRow, WorkspaceName $workspaceName, - ContentStreamId $contentStreamId, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): Node { @@ -85,8 +84,7 @@ public function mapNodeRowToNode( isset($nodeRow['lastmodified']) ? self::parseDateTimeString($nodeRow['lastmodified']) : null, isset($nodeRow['originallastmodified']) ? self::parseDateTimeString($nodeRow['originallastmodified']) : null, ), - $visibilityConstraints, - $contentStreamId + $visibilityConstraints ); } @@ -96,7 +94,6 @@ public function mapNodeRowToNode( public function mapNodeRowsToNodes( array $nodeRows, WorkspaceName $workspaceName, - ContentStreamId $contentStreamId, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): Nodes { @@ -104,7 +101,6 @@ public function mapNodeRowsToNodes( array_map(fn (array $nodeRow) => $this->mapNodeRowToNode( $nodeRow, $workspaceName, - $contentStreamId, $dimensionSpacePoint, $visibilityConstraints ), $nodeRows) @@ -125,7 +121,6 @@ public function createPropertyCollectionFromJsonString(string $jsonString): Prop public function mapReferenceRowsToReferences( array $nodeRows, WorkspaceName $workspaceName, - ContentStreamId $contentStreamId, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): References { @@ -134,7 +129,6 @@ public function mapReferenceRowsToReferences( $node = $this->mapNodeRowToNode( $nodeRow, $workspaceName, - $contentStreamId, $dimensionSpacePoint, $visibilityConstraints ); @@ -157,7 +151,6 @@ public function mapReferenceRowsToReferences( public function mapNodeRowsToNodeAggregate( array $nodeRows, WorkspaceName $workspaceName, - ContentStreamId $contentStreamId, VisibilityConstraints $visibilityConstraints ): ?NodeAggregate { if (empty($nodeRows)) { @@ -184,7 +177,6 @@ public function mapNodeRowsToNodeAggregate( $nodesByOccupiedDimensionSpacePoint[$occupiedDimensionSpacePoint->hash] = $this->mapNodeRowToNode( $nodeRow, $workspaceName, - $contentStreamId, $occupiedDimensionSpacePoint->toDimensionSpacePoint(), $visibilityConstraints ); @@ -240,7 +232,6 @@ public function mapNodeRowsToNodeAggregate( public function mapNodeRowsToNodeAggregates( array $nodeRows, WorkspaceName $workspaceName, - ContentStreamId $contentStreamId, VisibilityConstraints $visibilityConstraints ): NodeAggregates { if (empty($nodeRows)) { @@ -271,11 +262,10 @@ public function mapNodeRowsToNodeAggregates( // ... so we handle occupation exactly once ... $nodesByOccupiedDimensionSpacePointsByNodeAggregate [$rawNodeAggregateId][$occupiedDimensionSpacePoint->hash] = $this->mapNodeRowToNode( - $nodeRow, - $workspaceName, - $contentStreamId, - $occupiedDimensionSpacePoint->toDimensionSpacePoint(), - $visibilityConstraints + $nodeRow, + $workspaceName, + $occupiedDimensionSpacePoint->toDimensionSpacePoint(), + $visibilityConstraints ); $occupiedDimensionSpacePointsByNodeAggregate[$rawNodeAggregateId][] = $occupiedDimensionSpacePoint; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php index 91ab39a535e..3a8068b68dd 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php @@ -65,8 +65,7 @@ public function __construct( public function mapNodeRowToNode( array $nodeRow, VisibilityConstraints $visibilityConstraints, - ?DimensionSpacePoint $dimensionSpacePoint = null, - ?ContentStreamId $contentStreamId = null + ?DimensionSpacePoint $dimensionSpacePoint = null ): Node { return Node::create( $this->contentRepositoryId, @@ -92,7 +91,6 @@ public function mapNodeRowToNode( isset($nodeRow['originallastmodified']) ? self::parseDateTimeString($nodeRow['originallastmodified']) : null, ), $visibilityConstraints, - $contentStreamId ?: ContentStreamId::fromString($nodeRow['contentstreamid']), ); } @@ -101,16 +99,14 @@ public function mapNodeRowToNode( */ public function mapNodeRowsToNodes( array $nodeRows, - VisibilityConstraints $visibilityConstraints, - ContentStreamId $contentStreamId = null + VisibilityConstraints $visibilityConstraints ): Nodes { $nodes = []; foreach ($nodeRows as $nodeRow) { $nodes[] = $this->mapNodeRowToNode( $nodeRow, $visibilityConstraints, - null, - $contentStreamId + null ); } @@ -122,8 +118,7 @@ public function mapNodeRowsToNodes( */ public function mapReferenceRowsToReferences( array $referenceRows, - VisibilityConstraints $visibilityConstraints, - ContentStreamId $contentStreamId = null + VisibilityConstraints $visibilityConstraints ): References { $references = []; foreach ($referenceRows as $referenceRow) { @@ -131,8 +126,7 @@ public function mapReferenceRowsToReferences( $this->mapNodeRowToNode( $referenceRow, $visibilityConstraints, - null, - $contentStreamId + null ), ReferenceName::fromString($referenceRow['referencename']), $referenceRow['referenceproperties'] @@ -205,8 +199,7 @@ public function mapNodeRowsToNodeAggregate( $node = $this->mapNodeRowToNode( $nodeRow, $visibilityConstraints, - null, - $contentStreamId + null ); $nodeAggregateId = $nodeAggregateId ?: NodeAggregateId::fromString($nodeRow['nodeaggregateid']); @@ -291,8 +284,7 @@ public function mapNodeRowsToNodeAggregates(array $nodeRows, VisibilityConstrain $node = $this->mapNodeRowToNode( $nodeRow, $visibilityConstraints, - null, - $contentStreamId + null ); $nodeAggregateIds[$key] = NodeAggregateId::fromString( $nodeRow['nodeaggregateid'] diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php deleted file mode 100644 index 086d508b32d..00000000000 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php +++ /dev/null @@ -1,105 +0,0 @@ -contentRepositoryId->equals($other->contentRepositoryId) - && $this->contentStreamId->equals($other->contentStreamId) - && $this->dimensionSpacePoint->equals($other->dimensionSpacePoint) - && $this->visibilityConstraints->getHash() === $other->visibilityConstraints->getHash(); - } - - public function withContentStreamId(ContentStreamId $contentStreamId): self - { - return new self( - $this->contentRepositoryId, - $contentStreamId, - $this->dimensionSpacePoint, - $this->visibilityConstraints - ); - } - - public function withVisibilityConstraints(VisibilityConstraints $visibilityConstraints): self - { - return new self( - $this->contentRepositoryId, - $this->contentStreamId, - $this->dimensionSpacePoint, - $visibilityConstraints - ); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - return [ - 'contentRepositoryId' => $this->contentRepositoryId, - 'contentStreamId' => $this->contentStreamId, - 'dimensionSpacePoint' => $this->dimensionSpacePoint, - 'visibilityConstraints' => $this->visibilityConstraints - ]; - } -} diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php index dfc064beef1..e22058fda92 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php @@ -16,7 +16,6 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; -use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; @@ -24,7 +23,6 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Node\PropertyName; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -69,16 +67,6 @@ */ final readonly class Node { - /** - * This was intermediate part of the node's "Read Model" identity. - * Please use {@see $contentRepositoryId} {@see $workspaceName} {@see $dimensionSpacePoint} and {@see $aggregateId} instead, - * or see {@see NodeAddress::fromNode()} for passing the identity around. - * The visibility-constraints now reside in {@see $visibilityConstraints}. - * There is no replacement for the previously attached content-stream-id. Please refactor the code to use the newly available workspace-name. - * @deprecated will be removed before the final 9.0 release - */ - public ContentSubgraphIdentity $subgraphIdentity; - /** * @param ContentRepositoryId $contentRepositoryId The content-repository this Node belongs to * @param WorkspaceName $workspaceName The workspace of this Node @@ -105,27 +93,19 @@ private function __construct( public ?NodeName $name, public NodeTags $tags, public Timestamps $timestamps, - public VisibilityConstraints $visibilityConstraints, - ContentStreamId $contentStreamId + public VisibilityConstraints $visibilityConstraints ) { if ($this->classification->isTethered() && $this->name === null) { throw new \InvalidArgumentException('The NodeName must be set if the Node is tethered.', 1695118377); } - // legacy to be removed before Neos9 - $this->subgraphIdentity = ContentSubgraphIdentity::create( - $contentRepositoryId, - $contentStreamId, - $dimensionSpacePoint, - $visibilityConstraints - ); } /** * @internal The signature of this method can change in the future! */ - public static function create(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $aggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, PropertyCollection $properties, ?NodeName $nodeName, NodeTags $tags, Timestamps $timestamps, VisibilityConstraints $visibilityConstraints, ContentStreamId $contentStreamId): self + public static function create(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $aggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, PropertyCollection $properties, ?NodeName $name, NodeTags $tags, Timestamps $timestamps, VisibilityConstraints $visibilityConstraints): self { - return new self($contentRepositoryId, $workspaceName, $dimensionSpacePoint, $aggregateId, $originDimensionSpacePoint, $classification, $nodeTypeName, $properties, $nodeName, $tags, $timestamps, $visibilityConstraints, $contentStreamId); + return new self($contentRepositoryId, $workspaceName, $dimensionSpacePoint, $aggregateId, $originDimensionSpacePoint, $classification, $nodeTypeName, $properties, $name, $tags, $timestamps, $visibilityConstraints); } /** diff --git a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php index 7a06c14757a..c0dbeee5028 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php +++ b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php @@ -27,20 +27,16 @@ use Neos\ContentRepository\Core\Infrastructure\Property\Normalizer\ValueObjectIntDenormalizer; use Neos\ContentRepository\Core\Infrastructure\Property\Normalizer\ValueObjectStringDenormalizer; use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; -use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTags; use Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection; use Neos\ContentRepository\Core\Projection\ContentGraph\Timestamps; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer; use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer; @@ -109,7 +105,6 @@ public function createMinimalNodeOfType( new \DateTimeImmutable() ), VisibilityConstraints::withoutRestrictions(), - ContentStreamId::fromString('cs-id'), ); } } diff --git a/Neos.Neos/Classes/Service/ImageVariantGarbageCollector.php b/Neos.Neos/Classes/Service/ImageVariantGarbageCollector.php index 0f4e21b4838..e7b54a1cab1 100644 --- a/Neos.Neos/Classes/Service/ImageVariantGarbageCollector.php +++ b/Neos.Neos/Classes/Service/ImageVariantGarbageCollector.php @@ -50,6 +50,7 @@ class ImageVariantGarbageCollector * * Note: This method it triggered by the "nodePropertyChanged" signal, * @see \Neos\ContentRepository\Domain\Model\Node::emitNodePropertyChanged() + * TODO Fix with Neos9 !!! See https://github.com/neos/neos-development-collection/issues/5145 * * @param Node $node the affected node * @param string $propertyName name of the property that has been changed/added @@ -77,6 +78,7 @@ public function removeUnusedImageVariant(Node $node, $propertyName, $oldValue, $ // then we are safe to remove the asset here. if ( $usageItem instanceof AssetUsageReference + /** @phpstan-ignore-next-line todo needs repair see https://github.com/neos/neos-development-collection/issues/5145 */ && $usageItem->getContentStreamId()->equals($node->subgraphIdentity->contentStreamId) && $usageItem->getOriginDimensionSpacePoint()->equals($node->originDimensionSpacePoint) && $usageItem->getNodeAggregateId()->equals($node->aggregateId) diff --git a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php index cc239a574de..dabf8e835c1 100644 --- a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php +++ b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php @@ -11,21 +11,12 @@ * source code. */ -use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; -use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValue; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection; -use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTags; -use Neos\ContentRepository\Core\Projection\ContentGraph\Timestamps; -use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\TestSuite\Unit\NodeSubjectProvider; use Neos\Fusion\Tests\Functional\FusionObjects\AbstractFusionObjectTest; use Neos\Fusion\Tests\Functional\FusionObjects\TestingViewForFusionRuntime; @@ -151,13 +142,8 @@ protected function setUp(): void $now = new \DateTimeImmutable(); + /* $this->textNode = Node::create( - ContentSubgraphIdentity::create( - $contentRepositoryId, - ContentStreamId::fromString("cs"), - DimensionSpacePoint::createWithoutDimensions(), - VisibilityConstraints::withoutRestrictions() - ), NodeAggregateId::fromString("na"), OriginDimensionSpacePoint::createWithoutDimensions(), NodeAggregateClassification::CLASSIFICATION_REGULAR, @@ -168,5 +154,6 @@ protected function setUp(): void NodeTags::createEmpty(), Timestamps::create($now, $now, null, null) ); + */ } } diff --git a/Neos.Neos/Tests/Unit/Fusion/Helper/CachingHelperTest.php b/Neos.Neos/Tests/Unit/Fusion/Helper/CachingHelperTest.php index 78fdf3f3227..fcea3a4d362 100644 --- a/Neos.Neos/Tests/Unit/Fusion/Helper/CachingHelperTest.php +++ b/Neos.Neos/Tests/Unit/Fusion/Helper/CachingHelperTest.php @@ -239,7 +239,6 @@ private function createNode(NodeAggregateId $nodeAggregateId): Node NodeTags::createEmpty(), Timestamps::create($now, $now, null, null), VisibilityConstraints::withoutRestrictions(), - ContentStreamId::fromString("cs-identifier"), ); } }