diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php index 10c3ff66a2f..25b0a0d8810 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php @@ -87,7 +87,7 @@ protected function removeRelationRecursivelyFromDatabaseIncludingNonReferencedNo AND h.contentstreamid IS NULL ', [ - 'anchorPointForNode' => (string)$ingoingRelation->childNodeAnchor, + 'anchorPointForNode' => $ingoingRelation->childNodeAnchor->value, ] ); } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php index 94de4a1f0c1..d47a522d9fc 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php @@ -49,7 +49,7 @@ public function __construct( public function addToDatabase(Connection $databaseConnection, string $tableNamePrefix): void { $databaseConnection->insert($tableNamePrefix . '_node', [ - 'relationanchorpoint' => (string)$this->relationAnchorPoint, + 'relationanchorpoint' => $this->relationAnchorPoint->value, 'nodeaggregateid' => $this->nodeAggregateId->value, 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePointHash, diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index d8ddcb286bf..18df5147ac2 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -162,7 +162,7 @@ public function findRootNodeAggregates( $parameters = [ 'contentStreamId' => $contentStreamId->value, - 'rootEdgeParentAnchorId' => (string)NodeRelationAnchorPoint::forRootEdge(), + 'rootEdgeParentAnchorId' => NodeRelationAnchorPoint::forRootEdge()->value, ]; if ($filter->nodeTypeName !== null) { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php index 533b28c46cb..78a112ee5be 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php @@ -220,7 +220,7 @@ public function getNodeByAnchorPoint(NodeRelationAnchorPoint $nodeRelationAnchor 'SELECT n.* FROM ' . $this->tableNamePrefix . '_node n WHERE n.relationanchorpoint = :relationAnchorPoint', [ - 'relationAnchorPoint' => (string)$nodeRelationAnchorPoint, + 'relationAnchorPoint' => $nodeRelationAnchorPoint->value, ] )->fetchAssociative(); @@ -257,7 +257,7 @@ public function determineHierarchyRelationPosition( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ - 'succeedingSiblingAnchorPoint' => (string)$succeedingSiblingAnchorPoint, + 'succeedingSiblingAnchorPoint' => $succeedingSiblingAnchorPoint->value, 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] @@ -350,7 +350,7 @@ public function getOutgoingHierarchyRelationsForNodeAndSubgraph( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ - 'parentAnchorPoint' => (string)$parentAnchorPoint, + 'parentAnchorPoint' => $parentAnchorPoint->value, 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] @@ -382,7 +382,7 @@ public function getIngoingHierarchyRelationsForNodeAndSubgraph( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ - 'childAnchorPoint' => (string)$childAnchorPoint, + 'childAnchorPoint' => $childAnchorPoint->value, 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] @@ -411,7 +411,7 @@ public function findIngoingHierarchyRelationsForNode( WHERE h.childnodeanchor = :childAnchorPoint AND h.contentstreamid = :contentStreamId'; $parameters = [ - 'childAnchorPoint' => (string)$childAnchorPoint, + 'childAnchorPoint' => $childAnchorPoint->value, 'contentStreamId' => $contentStreamId->value ]; $types = []; @@ -449,7 +449,7 @@ public function findOutgoingHierarchyRelationsForNode( WHERE h.parentnodeanchor = :parentAnchorPoint AND h.contentstreamid = :contentStreamId'; $parameters = [ - 'parentAnchorPoint' => (string)$parentAnchorPoint, + 'parentAnchorPoint' => $parentAnchorPoint->value, 'contentStreamId' => $contentStreamId->value ]; $types = []; @@ -561,7 +561,7 @@ public function getAllContentStreamIdsAnchorPointIsContainedIn( FROM ' . $this->tableNamePrefix . '_hierarchyrelation h WHERE h.childnodeanchor = :nodeRelationAnchorPoint', [ - 'nodeRelationAnchorPoint' => (string)$nodeRelationAnchorPoint, + 'nodeRelationAnchorPoint' => $nodeRelationAnchorPoint->value, ] )->fetchAllAssociative() as $row ) { diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php index d954c05c068..6f0a93ca812 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php @@ -247,7 +247,7 @@ protected function replaceNodeRelationAnchorPoint( )'; $parameters = [ 'contentStreamId' => $contentStreamId->value, - 'newNodeRelationAnchorPoint' => (string)$newNodeRelationAnchorPoint, + 'newNodeRelationAnchorPoint' => $newNodeRelationAnchorPoint->value, 'affectedNodeAggregateId' => $affectedNodeAggregateId->value ]; foreach ($affectedDimensionSpacePointSet as $affectedDimensionSpacePoint) { diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php index f10278a91e8..f6d479a48c6 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php @@ -73,7 +73,7 @@ public function replaceParentNodeAnchor( $databaseConnection->update( $tableNamePrefix . '_hierarchyhyperrelation', [ - 'parentnodeanchor' => (string)$newParentNodeAnchor + 'parentnodeanchor' => $newParentNodeAnchor->value ], $this->getDatabaseIdentifier() ); @@ -169,7 +169,7 @@ public function getDatabaseIdentifier(): array { return [ 'contentstreamid' => $this->contentStreamId->value, - 'parentnodeanchor' => (string)$this->parentNodeAnchor, + 'parentnodeanchor' => $this->parentNodeAnchor->value, 'dimensionspacepointhash' => $this->dimensionSpacePoint->hash ]; } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php index 18257ab8eee..4c549f719ce 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php @@ -15,15 +15,15 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds - as NodeAggregateIdCollection; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds as NodeAggregateIdCollection; /** * The node aggregate identifier value object collection * * @internal + * @implements \IteratorAggregate */ -final class NodeAggregateIds +final class NodeAggregateIds implements \IteratorAggregate { /** * @var array @@ -69,16 +69,6 @@ public static function fromCollection( ); } - public static function fromDatabaseString(string $databaseString): self - { - return self::fromArray(\explode(',', \trim($databaseString, '{}'))); - } - - public function toDatabaseString(): string - { - return '{' . implode(',', $this->ids) . '}'; - } - public function add( NodeAggregateId $nodeAggregateId, ?NodeAggregateId $succeedingSibling = null @@ -108,4 +98,9 @@ public function isEmpty(): bool { return count($this->ids) === 0; } + + public function getIterator(): \Traversable + { + return new \ArrayIterator($this->ids); + } } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php index 865d37e8a8b..b1bb43f2692 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php @@ -90,14 +90,14 @@ public static function fromDatabaseRow(array $databaseRow): self public function addToDatabase(Connection $databaseConnection, string $tableNamePrefix): void { $databaseConnection->insert($tableNamePrefix . '_node', [ - 'relationanchorpoint' => (string) $this->relationAnchorPoint, + 'relationanchorpoint' => $this->relationAnchorPoint->value, 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePoint->hash, 'nodeaggregateid' => $this->nodeAggregateId->value, 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value, 'properties' => json_encode($this->properties), - 'nodename' => $this->nodeName->value + 'nodename' => $this->nodeName?->value ]); } @@ -115,7 +115,7 @@ public function updateToDatabase(Connection $databaseConnection, string $tableNa 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value, 'properties' => json_encode($this->properties), - 'nodename' => $this->nodeName->value, + 'nodename' => $this->nodeName?->value, ], [ 'relationanchorpoint' => $this->relationAnchorPoint diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php index 30184174c08..124f10c7933 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php @@ -52,7 +52,7 @@ public function findNodeRecordByRelationAnchorPoint( WHERE n.relationanchorpoint = :relationAnchorPoint'; $parameters = [ - 'relationAnchorPoint' => (string)$relationAnchorPoint + 'relationAnchorPoint' => $relationAnchorPoint->value ]; $result = $this->getDatabaseConnection()->executeQuery($query, $parameters)->fetchAssociative(); @@ -215,7 +215,7 @@ public function findIngoingHierarchyHyperrelationRecords( AND :childNodeAnchor = ANY(h.childnodeanchors)'; $parameters = [ 'contentStreamId' => $contentStreamId->value, - 'childNodeAnchor' => (string)$childNodeAnchor + 'childNodeAnchor' => $childNodeAnchor->value ]; $types = []; @@ -250,7 +250,7 @@ public function findOutgoingHierarchyHyperrelationRecords( AND h.parentnodeanchor = :parentNodeAnchor'; $parameters = [ 'contentStreamId' => $contentStreamId->value, - 'parentNodeAnchor' => (string)$parentNodeAnchor + 'parentNodeAnchor' => $parentNodeAnchor->value ]; $types = []; @@ -282,7 +282,7 @@ public function findOutgoingReferenceHyperrelationRecords( WHERE r.sourcenodeanchor = :sourceNodeAnchor'; $parameters = [ - 'sourceNodeAnchor' => (string)$sourceNodeAnchor + 'sourceNodeAnchor' => $sourceNodeAnchor->value ]; $referenceHyperrelations = []; @@ -312,7 +312,7 @@ public function findHierarchyHyperrelationRecordByParentNodeAnchor( $parameters = [ 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'parentNodeAnchor' => (string)$parentNodeAnchor + 'parentNodeAnchor' => $parentNodeAnchor->value ]; $result = $this->getDatabaseConnection()->executeQuery($query, $parameters)->fetchAssociative(); @@ -339,7 +339,7 @@ public function findHierarchyHyperrelationRecordByChildNodeAnchor( $parameters = [ 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'childNodeAnchor' => (string)$childNodeAnchor + 'childNodeAnchor' => $childNodeAnchor->value ]; $result = $this->getDatabaseConnection()->executeQuery($query, $parameters)->fetchAssociative(); @@ -361,7 +361,7 @@ public function findHierarchyHyperrelationRecordsByChildNodeAnchor( WHERE :childNodeAnchor = ANY(h.childnodeanchors)'; $parameters = [ - 'childNodeAnchor' => (string)$childNodeAnchor + 'childNodeAnchor' => $childNodeAnchor->value ]; $hierarchyRelationRecords = []; @@ -420,7 +420,7 @@ public function findCoverageByNodeRelationAnchorPoint( AND n.relationanchorpoint = :relationAnchorPoint'; $parameters = [ 'contentStreamId' => $contentStreamId->value, - 'relationanchorpoint' => (string)$nodeRelationAnchorPoint + 'relationanchorpoint' => $nodeRelationAnchorPoint->value ]; $dimensionSpacePoints = []; @@ -614,7 +614,7 @@ public function countContentStreamCoverage(NodeRelationAnchorPoint $anchorPoint) WHERE :anchorPoint = ANY(childnodeanchors)'; $parameters = [ - 'anchorPoint' => (string)$anchorPoint + 'anchorPoint' => $anchorPoint->value ]; return (int)$this->getDatabaseConnection()->executeQuery($query, $parameters)->rowCount(); diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php index 28331cf501d..6474b79c05c 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php @@ -58,7 +58,7 @@ public static function fromDatabaseRow(array $databaseRow): self public function addToDatabase(Connection $databaseConnection, string $tableNamePrefix): void { $databaseConnection->insert($tableNamePrefix . '_referencerelation', [ - 'sourcenodeanchor' => (string)$this->sourceNodeAnchor, + 'sourcenodeanchor' => $this->sourceNodeAnchor->value, 'name' => $this->name->value, 'position' => $this->position, 'properties' => $this->properties diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php index 345657cd38c..21de777d448 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php @@ -55,7 +55,7 @@ public static function fromDatabaseRow(array $databaseRow): self ContentStreamId::fromString($databaseRow['contentstreamid']), $databaseRow['dimensionspacepointhash'], NodeAggregateId::fromString($databaseRow['originnodeaggregateid']), - NodeAggregateIds::fromDatabaseString($databaseRow['affectednodeaggregateids']) + self::nodeAggregateIdsFromDatabaseString($databaseRow['affectednodeaggregateids']) ); } @@ -113,7 +113,7 @@ public function addToDatabase(Connection $databaseConnection, string $tableNameP $this->contentStreamId->value, $this->dimensionSpacePointHash, $this->originNodeAggregateId->value, - $this->affectedNodeAggregateIds->toDatabaseString() + self::nodeAggregateIdsToDatabaseString($this->affectedNodeAggregateIds), ] ); } @@ -129,7 +129,7 @@ private function updateAffectedNodeAggregateIds( $databaseConnection->update( $tableNamePrefix . '_restrictionhyperrelation', [ - 'affectednodeaggregateids' => $affectedNodeAggregateIds->toDatabaseString() + 'affectednodeaggregateids' => self::nodeAggregateIdsToDatabaseString($affectedNodeAggregateIds), ], $this->getDatabaseIdentifier() ); @@ -155,4 +155,14 @@ public function getDatabaseIdentifier(): array 'originnodeaggregateid' => $this->originNodeAggregateId->value ]; } + + private static function nodeAggregateIdsFromDatabaseString(string $databaseString): NodeAggregateIds + { + return NodeAggregateIds::fromArray(\explode(',', \trim($databaseString, '{}'))); + } + + private static function nodeAggregateIdsToDatabaseString(NodeAggregateIds $ids): string + { + return '{' . implode(',', array_map(static fn (NodeAggregateId $id) => $id->value, iterator_to_array($ids))) . '}'; + } } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php index 1f6fe760f2c..28376b7512d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php @@ -27,7 +27,7 @@ public function __construct( public static function graphProjectionTableNamePrefix( ContentRepositoryId $contentRepositoryId ): string { - return sprintf('cr_%s_p_hypergraph', $contentRepositoryId); + return sprintf('cr_%s_p_hypergraph', $contentRepositoryId->value); } public function build( diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php index 5019a9d1cf1..d497e981938 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php @@ -36,9 +36,9 @@ public function __construct( /** * @var array */ - public readonly array $weight + public readonly array $value ) { - foreach ($weight as $dimensionId => $specializationDepth) { + foreach ($value as $dimensionId => $specializationDepth) { if (!$specializationDepth instanceof Dimension\ContentDimensionValueSpecializationDepth) { throw new \InvalidArgumentException( sprintf( @@ -54,12 +54,12 @@ public function __construct( public function getWeightInDimension( Dimension\ContentDimensionId $dimensionId ): ?Dimension\ContentDimensionValueSpecializationDepth { - return $this->weight[$dimensionId->value] ?? null; + return $this->value[$dimensionId->value] ?? null; } public function canBeComparedTo(ContentSubgraphVariationWeight $other): bool { - return array_keys($other->weight) === array_keys($this->weight); + return array_keys($other->value) === array_keys($this->value); } /** @@ -71,7 +71,7 @@ public function decreaseBy(ContentSubgraphVariationWeight $other): ContentSubgra throw Exception\ContentSubgraphVariationWeightsAreIncomparable::butWereAttemptedTo($this, $other); } $decreasedWeight = []; - foreach ($this->weight as $rawDimensionId => $weight) { + foreach ($this->value as $rawDimensionId => $weight) { $dimensionId = new Dimension\ContentDimensionId($rawDimensionId); /** * @var Dimension\ContentDimensionValueSpecializationDepth $otherWeight @@ -87,9 +87,10 @@ public function decreaseBy(ContentSubgraphVariationWeight $other): ContentSubgra public function normalize(int $normalizationBase): int { $normalizedWeight = 0; - $exponent = count($this->weight) - 1; - foreach ($this->weight as $dimensionId => $specializationDepth) { - $normalizedWeight += pow($normalizationBase, $exponent) * $specializationDepth->depth; + $exponent = count($this->value) - 1; + /** @var Dimension\ContentDimensionValueSpecializationDepth $specializationDepth */ + foreach ($this->value as $dimensionId => $specializationDepth) { + $normalizedWeight += pow($normalizationBase, $exponent) * $specializationDepth->value; $exponent--; } @@ -101,7 +102,7 @@ public function normalize(int $normalizationBase): int */ public function jsonSerialize(): array { - return $this->weight; + return $this->value; } /** diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/ContentSubgraphVariationWeightsAreIncomparable.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/ContentSubgraphVariationWeightsAreIncomparable.php index 05d69dd4187..67769939354 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/ContentSubgraphVariationWeightsAreIncomparable.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/ContentSubgraphVariationWeightsAreIncomparable.php @@ -28,7 +28,7 @@ public static function butWereAttemptedTo( ContentSubgraphVariationWeight $second ): self { return new self( - 'Weights ' . $first . ' and ' . $second . ' cannot be compared.', + 'Weights ' . $first->toJson() . ' and ' . $second->toJson() . ' cannot be compared.', 1517474233 ); } diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointIsNoSpecialization.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointIsNoSpecialization.php index 97f38a0de31..3350ac8eaae 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointIsNoSpecialization.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointIsNoSpecialization.php @@ -27,8 +27,8 @@ public static function butWasSupposedToBe(DimensionSpacePoint $target, Dimension { return new self(sprintf( 'The Dimension space point %s is no specialization of %s.', - $target, - $source + $target->toJson(), + $source->toJson() ), 1617275140); } } diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointNotFound.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointNotFound.php index 8e968fde590..111ab435412 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointNotFound.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/Exception/DimensionSpacePointNotFound.php @@ -26,7 +26,7 @@ public static function becauseItIsNotWithinTheAllowedDimensionSubspace( DimensionSpacePoint $dimensionSpacePoint ): self { return new self( - sprintf('%s was not found in the allowed dimension subspace', $dimensionSpacePoint), + sprintf('%s was not found in the allowed dimension subspace', $dimensionSpacePoint->toJson()), 1505929456 ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php index c9c68b9d2c8..b7f5161a4fe 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php @@ -328,7 +328,7 @@ protected function requireNodeTypeConstraintsImposedByGrandparentToBeMet( ) ) { throw new NodeConstraintException( - 'Node type "' . $nodeType->name->value . '" is not allowed below tethered child nodes "' . $parentNodeName->value + 'Node type "' . $nodeType->name->value . '" is not allowed below tethered child nodes "' . $parentNodeName?->value . '" of nodes of type "' . $grandParentsNodeType->name->value . '"', 1520011791 ); @@ -415,7 +415,7 @@ public function requireProjectedParentNodeAggregate( if (!$parentNodeAggregate) { throw new NodeAggregateCurrentlyDoesNotExist( 'Parent node aggregate for ' . $childNodeAggregateId->value - . ' does currently not exist in origin dimension space point ' . $childOriginDimensionSpacePoint + . ' does currently not exist in origin dimension space point ' . $childOriginDimensionSpacePoint->toJson() . ' and content stream ' . $contentStreamId->value, 1645368685 ); @@ -540,7 +540,7 @@ protected function requireNodeNameToBeUnoccupied( throw new NodeNameIsAlreadyOccupied( 'Child node name "' . $nodeName->value . '" is already occupied for parent "' . $parentNodeAggregateId->value . '" in dimension space points ' - . $dimensionSpacePointsOccupiedByChildNodeName + . $dimensionSpacePointsOccupiedByChildNodeName->toJson() ); } } @@ -570,7 +570,7 @@ protected function requireNodeNameToBeUncovered( if (!$alreadyCoveredDimensionSpacePoints->isEmpty()) { throw new NodeNameIsAlreadyCovered( 'Node name "' . $nodeName->value . '" is already covered in dimension space points ' - . $alreadyCoveredDimensionSpacePoints . ' by node aggregate "' + . $alreadyCoveredDimensionSpacePoints->toJson() . ' by node aggregate "' . $childNodeAggregate->nodeAggregateId->value . '".' ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php index fe95b6b2afa..a6296468248 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php @@ -143,8 +143,8 @@ private static function requireDimensionSpacePointToBeEmptyInContentStream( if ($subgraph->countNodes() > 0) { throw new DimensionSpacePointAlreadyExists(sprintf( 'the content stream %s already contained nodes in dimension space point %s - this is not allowed.', - $contentStreamId, - $dimensionSpacePoint + $contentStreamId->value, + $dimensionSpacePoint->toJson(), ), 1612898126); } } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/SerializedPropertyValue.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/SerializedPropertyValue.php index 5b3af15b47c..57ba6eaba4a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/SerializedPropertyValue.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/SerializedPropertyValue.php @@ -58,6 +58,10 @@ public function jsonSerialize(): array ]; } + /** + * @return array + * @throws \JsonException + */ public function __debugInfo(): array { return [ diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php index 9cd8f6e3b06..136c89a36c5 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php @@ -395,7 +395,7 @@ private function resolveCoverageNodeMoveMappings( $parentOfSucceedingSibling = $contentSubgraph->findParentNode($succeedingSibling->nodeAggregateId); if ($parentOfSucceedingSibling === null) { throw new \InvalidArgumentException( - 'Parent of succeeding sibling ' . $succeedingSibling->nodeAggregateId + 'Parent of succeeding sibling ' . $succeedingSibling->nodeAggregateId->value . ' not found in subgraph ' . json_encode($contentSubgraph), 1667817639 ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index 9ec66b9791b..6db1e898724 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -382,7 +382,7 @@ private function deleteObsoleteTetheredNodesWhenChangingNodeType( foreach ($tetheredNodeAggregates as $tetheredNodeAggregate) { /* @var $tetheredNodeAggregate NodeAggregate */ - if (!isset($expectedTetheredNodes[$tetheredNodeAggregate->nodeName->value])) { + if ($tetheredNodeAggregate->nodeName !== null && !isset($expectedTetheredNodes[$tetheredNodeAggregate->nodeName->value])) { // this aggregate (or parts thereof) are DISALLOWED according to constraints. // We now need to find out which edges we need to remove, $dimensionSpacePointsToBeRemoved = $this->findDimensionSpacePointsConnectingParentAndChildAggregate( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index 4decc2f797c..17183cad2e5 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -111,7 +111,7 @@ private function handleCreateWorkspace( if ($existingWorkspace !== null) { throw new WorkspaceAlreadyExists(sprintf( 'The workspace %s already exists', - $command->workspaceName + $command->workspaceName->value ), 1505830958921); } @@ -119,8 +119,8 @@ private function handleCreateWorkspace( if ($baseWorkspace === null) { throw new BaseWorkspaceDoesNotExist(sprintf( 'The workspace %s (base workspace of %s) does not exist', - $command->baseWorkspaceName, - $command->workspaceName + $command->baseWorkspaceName->value, + $command->workspaceName->value ), 1513890708); } @@ -164,7 +164,7 @@ private function handleCreateRootWorkspace( if ($existingWorkspace !== null) { throw new WorkspaceAlreadyExists(sprintf( 'The workspace %s already exists', - $command->workspaceName + $command->workspaceName->value ), 1505848624450); } @@ -311,7 +311,7 @@ private function publishContentStream( 'The base workspace has been modified in the meantime; please rebase.' . ' Expected version %d of source content stream %s', $contentStreamWasForkedEvent->versionOfSourceContentStream->value, - $baseContentStreamId + $baseContentStreamId->value )); } } @@ -375,11 +375,11 @@ private function handleRebaseWorkspace( "The content stream %s cannot be rebased. Error with command %d (%s)" . " - see nested exception for details.\n\n The base workspace %s is at content stream %s." . "\n The full list of commands applied so far is: %s", - $workspaceContentStreamName, + $workspaceContentStreamName->value, $i, get_class($commandToRebase), - $baseWorkspace->workspaceName, - $baseWorkspace->currentContentStreamId, + $baseWorkspace->workspaceName->value, + $baseWorkspace->currentContentStreamId->value, $fullCommandListSoFar ), $e); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Exception/BaseWorkspaceDoesNotExist.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Exception/BaseWorkspaceDoesNotExist.php index ed461120e1e..ed3117bb0ff 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Exception/BaseWorkspaceDoesNotExist.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Exception/BaseWorkspaceDoesNotExist.php @@ -25,7 +25,7 @@ public static function butWasSupposedTo(WorkspaceName $name): self { return new self(sprintf( 'No base workspace exists for given workspace workspace %s', - $name + $name->value ), 1513924882); } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Nodes.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Nodes.php index 096e9edff9a..b19bc3a95af 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Nodes.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Nodes.php @@ -130,7 +130,7 @@ private function getNodeIndex(Node $subject): int } throw new \InvalidArgumentException(sprintf( 'The node %s does not exist in this set', - $subject->nodeAggregateId + $subject->nodeAggregateId->value ), 1542901216); } diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php index e08879af0c7..db8414b0875 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php @@ -44,10 +44,11 @@ public function findOneByName(WorkspaceName $name): ?Workspace } $connection = $this->client->getConnection(); - $workspaceRow = $connection->executeQuery(' - SELECT * FROM ' . $this->tableName . ' - WHERE workspaceName = :workspaceName - ', + $workspaceRow = $connection->executeQuery( + ' + SELECT * FROM ' . $this->tableName . ' + WHERE workspaceName = :workspaceName + ', [ 'workspaceName' => $name->value, ] diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php index 5f3981f1317..22b5d218c99 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php @@ -31,7 +31,7 @@ public static function butWasSupposedTo( ): self { return new self( 'Node aggregate "' . $nodeAggregateId->value - . '" does currently not cover dimension space point ' . $coveredDimensionSpacePoint, + . '" does currently not cover dimension space point ' . $coveredDimensionSpacePoint->toJson(), 1554902892 ); } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php index 780da729258..fa02abbbe74 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php @@ -32,7 +32,7 @@ public static function butWasSupposedTo( ): NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet { return new self( 'Node aggregate "' . $nodeAggregateId->value . '" does not cover expected dimension space point set ' - . $expectedCoveredDimensionSpacePointSet . ' but ' . $actualDimensionSpacePointSet . '.', + . $expectedCoveredDimensionSpacePointSet->toJson() . ' but ' . $actualDimensionSpacePointSet->toJson() . '.', 1571134743 ); } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php index 71d917c2204..a46f6444695 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php @@ -31,7 +31,7 @@ public static function butWasSupposedTo( ): self { return new self( 'Node aggregate "' . $nodeAggregateId->value - . '" does currently not occupy dimension space point ' . $occupiedDimensionSpacePoint, + . '" does currently not occupy dimension space point ' . $occupiedDimensionSpacePoint->toJson(), 1554902613 ); } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php index 2d3da324d54..3def569da87 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php @@ -25,7 +25,7 @@ public static function butWasSupposedTo(WorkspaceName $name): self { return new self(sprintf( 'The source workspace %s does not exist', - $name + $name->value ), 1513924741); } } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceHasNoBaseWorkspaceName.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceHasNoBaseWorkspaceName.php index 5d1d6689219..b75479af816 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceHasNoBaseWorkspaceName.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceHasNoBaseWorkspaceName.php @@ -25,7 +25,7 @@ public static function butWasSupposedTo(WorkspaceName $name): self { return new self(sprintf( 'The workspace %s has no base workspace name.', - $name + $name->value ), 1645381818); } } diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/CurrentSubgraphTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/CurrentSubgraphTrait.php index 0ebcc41e9d2..0999c8cf630 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/CurrentSubgraphTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/CurrentSubgraphTrait.php @@ -76,7 +76,7 @@ public function iAmInTheActiveContentStreamOfWorkspaceAndDimensionSpacePoint(str $workspaceName = WorkspaceName::fromString($workspaceName); $workspace = $this->getWorkspaceFinder()->findOneByName($workspaceName); if ($workspace === null) { - throw new \Exception(sprintf('Workspace "%s" does not exist, projection not yet up to date?', $workspaceName), 1548149355); + throw new \Exception(sprintf('Workspace "%s" does not exist, projection not yet up to date?', $workspaceName->value), 1548149355); } $this->contentStreamId = $workspace->currentContentStreamId; $this->dimensionSpacePoint = DimensionSpacePoint::fromJsonString($dimensionSpacePoint); diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php index b7170a1d826..f96cc1c7a3e 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php @@ -48,7 +48,7 @@ public function iExpectTheNodeAggregateToExist(string $serializedNodeAggregateId $nodeAggregateId = NodeAggregateId::fromString($serializedNodeAggregateId); $this->initializeCurrentNodeAggregates(function (ContentGraphInterface $contentGraph, string $adapterName) use ($nodeAggregateId) { $currentNodeAggregate = $contentGraph->findNodeAggregateById($this->contentStreamId, $nodeAggregateId); - Assert::assertNotNull($currentNodeAggregate, sprintf('Node aggregate "%s" was not found in the current content stream "%s" in adapter "%s".', $nodeAggregateId, $this->contentStreamId, $adapterName)); + Assert::assertNotNull($currentNodeAggregate, sprintf('Node aggregate "%s" was not found in the current content stream "%s" in adapter "%s".', $nodeAggregateId->value, $this->contentStreamId, $adapterName)); return $currentNodeAggregate; }); } @@ -75,7 +75,7 @@ public function iExpectThisNodeAggregateToOccupyDimensionSpacePoints(string $ser $expectedOccupation, $nodeAggregate->occupiedDimensionSpacePoints, 'Node aggregate origins do not match in adapter "' . $adapterName . '". Expected: ' . - $expectedOccupation . ', actual: ' . $nodeAggregate->occupiedDimensionSpacePoints + $expectedOccupation->toJson() . ', actual: ' . $nodeAggregate->occupiedDimensionSpacePoints->toJson() ); }); } @@ -91,7 +91,7 @@ public function iExpectThisNodeAggregateToCoverDimensionSpacePoints(string $seri Assert::assertEquals( $expectedCoverage, $nodeAggregate->coveredDimensionSpacePoints, - 'Expected node aggregate coverage ' . $expectedCoverage . ', got ' . $nodeAggregate->coveredDimensionSpacePoints . ' in adapter "' . $adapterName . '"' + 'Expected node aggregate coverage ' . $expectedCoverage->toJson() . ', got ' . $nodeAggregate->coveredDimensionSpacePoints->toJson() . ' in adapter "' . $adapterName . '"' ); }); } @@ -107,8 +107,8 @@ public function iExpectThisNodeAggregateToDisableDimensionSpacePoints(string $se Assert::assertEquals( $expectedDisabledDimensionSpacePoints, $nodeAggregate->disabledDimensionSpacePoints, - 'Expected disabled dimension space point set ' . $expectedDisabledDimensionSpacePoints . ', got ' . - $nodeAggregate->disabledDimensionSpacePoints . ' in adapter "' . $adapterName . '"' + 'Expected disabled dimension space point set ' . $expectedDisabledDimensionSpacePoints->toJson() . ', got ' . + $nodeAggregate->disabledDimensionSpacePoints->toJson() . ' in adapter "' . $adapterName . '"' ); }); } diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php index b51ac21a111..9fc4954e305 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php @@ -101,9 +101,9 @@ public function iExpectANodeIdentifiedByXToExistInTheContentGraph(string $serial ); Assert::assertNotNull( $currentNode, - 'Node with aggregate id "' . $nodeDiscriminator->getNodeAggregateId() - . '" and originating in dimension space point "' . $nodeDiscriminator->getOriginDimensionSpacePoint() - . '" was not found in content stream "' . $nodeDiscriminator->getContentStreamId() . '"' + 'Node with aggregate id "' . $nodeDiscriminator->getNodeAggregateId()->value + . '" and originating in dimension space point "' . $nodeDiscriminator->getOriginDimensionSpacePoint()->toJson() + . '" was not found in content stream "' . $nodeDiscriminator->getContentStreamId()->value . '"' . '" in adapter "' . $adapterName . '"' ); diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php index a9b3e78dc35..f7479da4c39 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php @@ -31,16 +31,16 @@ public function run(iterable $nodeDataRows): iterable // Note: We use a PostgreSQL platform because the implementation is forward-compatible, @see JsonArrayType::convertToPHPValue() $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQL100Platform()); } catch (\Throwable $e) { - throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s"): %s', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeTypeName, $e->getMessage()), 1656057030, $e); + throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s"): %s', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeTypeName->value, $e->getMessage()), 1656057030, $e); } if (!is_array($decodedProperties)) { - throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s")', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeTypeName), 1656057035); + throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s")', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeTypeName->value), 1656057035); } foreach ($decodedProperties as $propertyName => $propertyValue) { try { yield from $this->extractAssets($propertyValue); } catch (\Throwable $e) { - throw new MigrationException(sprintf('Failed to extract assets from property "%s" of node "%s" (type: "%s"): %s', $propertyName, $nodeDataRow['identifier'], $nodeTypeName, $e->getMessage()), 1656931260, $e); + throw new MigrationException(sprintf('Failed to extract assets from property "%s" of node "%s" (type: "%s"): %s', $propertyName, $nodeDataRow['identifier'], $nodeTypeName->value, $e->getMessage()), 1656931260, $e); } } } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregate.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregate.php index e0376cad2ef..a3bee18746f 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregate.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregate.php @@ -29,7 +29,7 @@ public function __construct( public function addVariant(OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId): void { if (isset($this->variants[$originDimensionSpacePoint->hash])) { - throw new MigrationException(sprintf('Node "%s" with dimension space point "%s" was already visited before', $this->nodeAggregateId, $originDimensionSpacePoint), 1653050442); + throw new MigrationException(sprintf('Node "%s" with dimension space point "%s" was already visited before', $this->nodeAggregateId->value, $originDimensionSpacePoint->toJson()), 1653050442); } $this->variants[$originDimensionSpacePoint->hash] = new VisitedNodeVariant($originDimensionSpacePoint, $parentNodeAggregateId); } @@ -42,7 +42,7 @@ public function getOriginDimensionSpacePoints(): OriginDimensionSpacePointSet public function getVariant(OriginDimensionSpacePoint $originDimensionSpacePoint): VisitedNodeVariant { if (!isset($this->variants[$originDimensionSpacePoint->hash])) { - throw new \InvalidArgumentException(sprintf('Variant %s of node "%s" has not been visited before', $originDimensionSpacePoint, $this->nodeAggregateId), 1656058159); + throw new \InvalidArgumentException(sprintf('Variant %s of node "%s" has not been visited before', $originDimensionSpacePoint->toJson(), $this->nodeAggregateId->value), 1656058159); } return $this->variants[$originDimensionSpacePoint->hash]; } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregates.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregates.php index d2d8d4be57a..e5e31480011 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregates.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/VisitedNodeAggregates.php @@ -37,13 +37,13 @@ public function add(NodeAggregateId $nodeAggregateId, DimensionSpacePointSet $co { $visitedNodeAggregate = $this->byNodeAggregateId[$nodeAggregateId->value] ?? new VisitedNodeAggregate($nodeAggregateId, $nodeTypeName); if (!$nodeTypeName->equals($visitedNodeAggregate->nodeTypeName)) { - throw new MigrationException(sprintf('Node aggregate with id "%s" has a type of "%s" in content dimension %s. I was visited previously for content dimension %s with the type "%s". Node variants must not have different types', $nodeAggregateId, $nodeTypeName, $coveredDimensionSpacePoints, $visitedNodeAggregate->getOriginDimensionSpacePoints(), $visitedNodeAggregate->nodeTypeName), 1655913685); + throw new MigrationException(sprintf('Node aggregate with id "%s" has a type of "%s" in content dimension %s. I was visited previously for content dimension %s with the type "%s". Node variants must not have different types', $nodeAggregateId->value, $nodeTypeName->value, $coveredDimensionSpacePoints->toJson(), $visitedNodeAggregate->getOriginDimensionSpacePoints()->toJson(), $visitedNodeAggregate->nodeTypeName->value), 1655913685); } foreach ($coveredDimensionSpacePoints as $dimensionSpacePoint) { $visitedNodeAggregate->addVariant(OriginDimensionSpacePoint::fromDimensionSpacePoint($dimensionSpacePoint), $parentNodeAggregateId); $pathAndDimensionSpacePointHash = $nodePath->jsonSerialize() . '__' . $dimensionSpacePoint->hash; if (isset($this->byPathAndDimensionSpacePoint[$pathAndDimensionSpacePointHash])) { - throw new MigrationException(sprintf('Node "%s" with path "%s" and dimension space point "%s" was already visited before', $nodeAggregateId, $nodePath, $dimensionSpacePoint), 1655900356); + throw new MigrationException(sprintf('Node "%s" with path "%s" and dimension space point "%s" was already visited before', $nodeAggregateId->value, $nodePath->value, $dimensionSpacePoint->toJson()), 1655900356); } $this->byPathAndDimensionSpacePoint[$pathAndDimensionSpacePointHash] = $visitedNodeAggregate; } @@ -58,7 +58,7 @@ public function containsNodeAggregate(NodeAggregateId $nodeAggregateId): bool public function getByNodeAggregateId(NodeAggregateId $nodeAggregateId): VisitedNodeAggregate { if (!isset($this->byNodeAggregateId[$nodeAggregateId->value])) { - throw new \InvalidArgumentException(sprintf('Node aggregate with id "%s" has not been visited before', $nodeAggregateId), 1655912733); + throw new \InvalidArgumentException(sprintf('Node aggregate with id "%s" has not been visited before', $nodeAggregateId->value), 1655912733); } return $this->byNodeAggregateId[$nodeAggregateId->value]; } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index 28b084b2daa..d5a0bcf7daf 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -193,7 +193,7 @@ private function processNodeData(array $nodeDataRow): void $originDimensionSpacePoint = OriginDimensionSpacePoint::fromLegacyDimensionArray($dimensionArray); $parentNodeAggregate = $this->visitedNodes->findMostSpecificParentNodeInDimensionGraph($nodePath, $originDimensionSpacePoint, $this->interDimensionalVariationGraph); if ($parentNodeAggregate === null) { - throw new MigrationException(sprintf('Failed to find parent node for node with id "%s" and dimensions: %s. Did you properly configure your dimensions setup to be in sync with the old setup?', $nodeAggregateId, $originDimensionSpacePoint), 1655980069); + throw new MigrationException(sprintf('Failed to find parent node for node with id "%s" and dimensions: %s. Did you properly configure your dimensions setup to be in sync with the old setup?', $nodeAggregateId->value, $originDimensionSpacePoint->toJson()), 1655980069); } $pathParts = $nodePath->getParts(); $nodeName = end($pathParts); @@ -232,7 +232,7 @@ public function extractPropertyValuesAndReferences(array $nodeDataRow, NodeType // Note: We use a PostgreSQL platform because the implementation is forward-compatible, @see JsonArrayType::convertToPHPValue() $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQL100Platform()); if (!is_array($decodedProperties)) { - throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s")', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeType), 1656057035); + throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s")', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeType->name), 1656057035); } foreach ($decodedProperties as $propertyName => $propertyValue) { @@ -292,7 +292,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen } } if ($variantCreatedEvent === null) { - throw new MigrationException(sprintf('Node "%s" for dimension %s was already created previously', $nodeAggregateId, $originDimensionSpacePoint), 1656057201); + throw new MigrationException(sprintf('Node "%s" for dimension %s was already created previously', $nodeAggregateId->value, $originDimensionSpacePoint->toJson()), 1656057201); } $this->exportEvent($variantCreatedEvent); if ($serializedPropertyValuesAndReferences->serializedPropertyValues->count() > 0) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php index df31030ee87..07dcf3137e0 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php @@ -198,7 +198,7 @@ protected function getEntryPoints(array $contextNodes): array assert($contextNode instanceof Node); $subgraph = $this->contentRepositoryRegistry->subgraphForNode($contextNode); $subgraphIdentifier = md5($contextNode->subgraphIdentity->contentStreamId->value - . '@' . $contextNode->subgraphIdentity->dimensionSpacePoint); + . '@' . $contextNode->subgraphIdentity->dimensionSpacePoint->toJson()); if (!isset($entryPoints[(string) $subgraphIdentifier])) { $entryPoints[(string) $subgraphIdentifier] = [ 'subgraph' => $subgraph, diff --git a/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php b/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php index a0c020e9eab..4047654660c 100644 --- a/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php +++ b/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php @@ -64,7 +64,7 @@ public function executeMigration(ExecuteMigration $command): void if ($workspace === null) { throw new WorkspaceDoesNotExist(sprintf( 'The workspace %s does not exist', - $command->getWorkspaceName() + $command->getWorkspaceName()->value ), 1611688225); } diff --git a/Neos.ContentRepository.Security/Classes/Service/AuthorizationService.php b/Neos.ContentRepository.Security/Classes/Service/AuthorizationService.php index 866b4938b4b..c95ff197d5f 100644 --- a/Neos.ContentRepository.Security/Classes/Service/AuthorizationService.php +++ b/Neos.ContentRepository.Security/Classes/Service/AuthorizationService.php @@ -98,10 +98,14 @@ public function getNodeTypeNamesDeniedForCreation(Node $referenceNode) continue; } - $affectedNodeTypes = ($createNodePrivilege->getCreationNodeTypes() !== [] ? $createNodePrivilege->getCreationNodeTypes() : $allNodeTypes); + if ($createNodePrivilege->getCreationNodeTypes() !== []) { + $affectedNodeTypes = $createNodePrivilege->getCreationNodeTypes(); + } else { + $affectedNodeTypes = array_map(static fn (NodeType $nodeType) => $nodeType->name->value, $allNodeTypes); + } if ($createNodePrivilege->isGranted()) { - $grantedCreationNodeTypes = array_merge($grantedCreationNodeTypes, $affectedNodeTypes); + $grantedCreationNodeTypes[] = array_merge($grantedCreationNodeTypes, $affectedNodeTypes); } elseif ($createNodePrivilege->isDenied()) { $deniedCreationNodeTypes = array_merge($deniedCreationNodeTypes, $affectedNodeTypes); } else { diff --git a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php index e109dd8f8de..69a82b3e23c 100644 --- a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php +++ b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php @@ -38,7 +38,7 @@ public function getName(): string LogEnvironment::fromMethodName(__METHOD__) ); - return $this->childWorkspace->baseWorkspaceName->value; + return $this->childWorkspace->baseWorkspaceName?->value ?? ''; } /** diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index 58196d97ea5..ac2047aa309 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -318,7 +318,7 @@ public function updateAction(Workspace $workspace) #$this->workspaceFinder->update($workspace); $this->addFlashMessage($this->translator->translateById( 'workspaces.workspaceHasBeenUpdated', - [$workspace->workspaceTitle->value], + [$workspace->workspaceTitle?->value], null, null, 'Modules', @@ -349,12 +349,12 @@ public function deleteAction(Workspace $workspace) $dependentWorkspaceTitles = []; /** @var Workspace $dependentWorkspace */ foreach ($dependentWorkspaces as $dependentWorkspace) { - $dependentWorkspaceTitles[] = $dependentWorkspace->workspaceTitle->value; + $dependentWorkspaceTitles[] = $dependentWorkspace->workspaceTitle?->value; } $message = $this->translator->translateById( 'workspaces.workspaceCannotBeDeletedBecauseOfDependencies', - [$workspace->workspaceTitle->value, implode(', ', $dependentWorkspaceTitles)], + [$workspace->workspaceTitle?->value, implode(', ', $dependentWorkspaceTitles)], null, null, 'Modules', @@ -383,7 +383,7 @@ public function deleteAction(Workspace $workspace) //if ($nodesCount > 0) { $message = $this->translator->translateById( 'workspaces.workspaceCannotBeDeletedBecauseOfUnpublishedNodes', - [$workspace->workspaceTitle->value, $nodesCount], + [$workspace->workspaceTitle?->value, $nodesCount], $nodesCount, null, 'Modules', @@ -396,7 +396,7 @@ public function deleteAction(Workspace $workspace) //$this->workspaceFinder->remove($workspace); $this->addFlashMessage($this->translator->translateById( 'workspaces.workspaceHasBeenRemoved', - [$workspace->workspaceTitle->value], + [$workspace->workspaceTitle?->value], null, null, 'Modules', @@ -1017,7 +1017,7 @@ protected function postProcessDiffArray(array &$diffArray): void * * @param ContentRepository $contentRepository * @param Workspace|null $excludedWorkspace - * @return array + * @return array */ protected function prepareBaseWorkspaceOptions( ContentRepository $contentRepository, @@ -1036,7 +1036,7 @@ protected function prepareBaseWorkspaceOptions( || $this->domainUserService->currentUserCanManageWorkspace($workspace)) && (!$excludedWorkspace || $workspaces->getBaseWorkspaces($workspace->workspaceName)->get($excludedWorkspace->workspaceName) === null) ) { - $baseWorkspaceOptions[$workspace->workspaceName->value] = $workspace->workspaceTitle->value; + $baseWorkspaceOptions[$workspace->workspaceName->value] = $workspace->workspaceTitle?->value; } } diff --git a/Neos.Neos/Classes/Domain/Service/FusionService.php b/Neos.Neos/Classes/Domain/Service/FusionService.php index 00931ab86aa..2cb588630be 100644 --- a/Neos.Neos/Classes/Domain/Service/FusionService.php +++ b/Neos.Neos/Classes/Domain/Service/FusionService.php @@ -165,6 +165,9 @@ public function getMergedFusionObjectTree(Node $startNode) protected function getSiteForSiteNode(Node $siteNode): ?Site { + if ($siteNode->nodeName === null) { + return null; + } return $this->siteRepository->findOneByNodeName($siteNode->nodeName->value); } diff --git a/Neos.Neos/Classes/Domain/Service/SiteService.php b/Neos.Neos/Classes/Domain/Service/SiteService.php index bcd07a09439..75445d29a83 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteService.php +++ b/Neos.Neos/Classes/Domain/Service/SiteService.php @@ -127,6 +127,9 @@ public function assignUploadedAssetToSiteAssetCollection(Asset $asset, Node $nod return; } + if ($siteNode->nodeName === null) { + return; + } $site = $this->siteRepository->findOneByNodeName($siteNode->nodeName->value); if ($site === null) { return; diff --git a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php index 46c8e466401..ac156ea9451 100644 --- a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php +++ b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php @@ -133,7 +133,7 @@ private static function calculateUriPaths(Segments $segments, Separator $separat if (isset($uriPathToDimensionSpacePoint[$uriPathSegment])) { throw new UriPathResolverConfigurationException( 'Uri path segment "' . $uriPathSegment - . '" already configured by dimension ' . $uriPathToDimensionSpacePoint[$uriPathSegment] + . '" already configured by dimension ' . $uriPathToDimensionSpacePoint[$uriPathSegment]->toJson() . '. Thus, we cannot use it for dimension ' . json_encode($dimensionSpacePointCoordinates) ); } diff --git a/Neos.Neos/Classes/FrontendRouting/NodeAddress.php b/Neos.Neos/Classes/FrontendRouting/NodeAddress.php index cb621ef16be..c967d072bc3 100644 --- a/Neos.Neos/Classes/FrontendRouting/NodeAddress.php +++ b/Neos.Neos/Classes/FrontendRouting/NodeAddress.php @@ -75,10 +75,10 @@ public function __toString(): string { return sprintf( 'NodeAddress[contentStream=%s, dimensionSpacePoint=%s, nodeAggregateId=%s, workspaceName=%s]', - $this->contentStreamId, - $this->dimensionSpacePoint, - $this->nodeAggregateId, - $this->workspaceName + $this->contentStreamId->value, + $this->dimensionSpacePoint->toJson(), + $this->nodeAggregateId->value, + $this->workspaceName->value ); } } diff --git a/Neos.Neos/Classes/FrontendRouting/NodeShortcutResolver.php b/Neos.Neos/Classes/FrontendRouting/NodeShortcutResolver.php index 1be565807ca..d1d6ad5b679 100644 --- a/Neos.Neos/Classes/FrontendRouting/NodeShortcutResolver.php +++ b/Neos.Neos/Classes/FrontendRouting/NodeShortcutResolver.php @@ -113,14 +113,14 @@ public function resolveNode( throw new InvalidShortcutException(sprintf( 'Shortcut Node "%s" points to a non-existing parent node "%s"', $documentNodeInfo, - $documentNodeInfo->getNodeAggregateId() + $documentNodeInfo->getNodeAggregateId()->value ), 1599669406, $e); } if ($documentNodeInfo->isDisabled()) { throw new InvalidShortcutException(sprintf( 'Shortcut Node "%s" points to disabled parent node "%s"', $documentNodeInfo, - $documentNodeInfo->getNodeAggregateId() + $documentNodeInfo->getNodeAggregateId()->value ), 1599664517); } continue 2; @@ -166,7 +166,7 @@ public function resolveNode( throw new InvalidShortcutException(sprintf( 'Shortcut target in Node "%s" points to disabled node "%s"', $documentNodeInfo, - $documentNodeInfo->getNodeAggregateId() + $documentNodeInfo->getNodeAggregateId()->value ), 1599664423); } continue 2; diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index 35ff6354951..d45cac9ae83 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -207,7 +207,7 @@ private function whenRootWorkspaceWasCreated(RootWorkspaceWasCreated $event): vo } catch (DBALException $e) { throw new \RuntimeException(sprintf( 'Failed to insert root content stream id of the root workspace "%s": %s', - $event->workspaceName, + $event->workspaceName->value, $e->getMessage() ), 1599646608, $e); } @@ -783,7 +783,7 @@ private function updateNodeByIdAndDimensionSpacePointHash( } catch (DBALException $e) { throw new \RuntimeException(sprintf( 'Failed to update node "%s": %s', - $nodeAggregateId, + $nodeAggregateId->value, $e->getMessage() ), 1599646777, $e); } @@ -821,7 +821,7 @@ private function deleteNodeByIdAndDimensionSpacePointHash( } catch (DBALException $e) { throw new \RuntimeException(sprintf( 'Failed to delete node "%s": %s', - $nodeAggregateId, + $nodeAggregateId->value, $e->getMessage() ), 1599655284, $e); } diff --git a/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php b/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php index 6efbde6675e..71a64e4a356 100644 --- a/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php +++ b/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php @@ -119,7 +119,7 @@ public function flushNodeAggregate( $tagsToFlush[$tagName] = sprintf( 'which were tagged with "%s" because node "%s" has changed.', $tagName, - $nodeAggregate->nodeAggregateId + $nodeAggregate->nodeAggregateId->value ); // Legacy @@ -127,7 +127,7 @@ public function flushNodeAggregate( $tagsToFlush[$legacyTagName] = sprintf( 'which were tagged with legacy "%s" because node "%s" has changed.', $legacyTagName, - $nodeAggregate->nodeAggregateId + $nodeAggregate->nodeAggregateId->value ); foreach ( @@ -209,16 +209,16 @@ private function registerChangeOnNodeType( $tagsToFlush['NodeType_%' . $contentStreamId->value . '%_' . $nodeTypeNameToFlush] = sprintf( 'which were tagged with "NodeType_%s" because node "%s" has changed and was of type "%s".', $nodeTypeNameToFlush, - ($referenceNodeIdentifier ?: ''), - $nodeTypeName + ($referenceNodeIdentifier?->value ?? ''), + $nodeTypeName->value ); // Legacy, but still used $tagsToFlush['NodeType_' . $nodeTypeNameToFlush] = sprintf( 'which were tagged with "NodeType_%s" because node "%s" has changed and was of type "%s".', $nodeTypeNameToFlush, - ($referenceNodeIdentifier ?: ''), - $nodeTypeName + ($referenceNodeIdentifier->value ?? ''), + $nodeTypeName->value ); } } diff --git a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php index 33889e702d7..1d9ed58c17c 100644 --- a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php @@ -157,7 +157,7 @@ protected function getNodeTypeTagFor($nodeType, Node $contextNode = null) $nodeTypeName .= $nodeType; } if ($nodeType instanceof NodeType) { - $nodeTypeName .= $nodeType->name; + $nodeTypeName .= $nodeType->name->value; } if ($nodeTypeName === '') { diff --git a/Neos.Neos/Classes/Fusion/Helper/LinkHelper.php b/Neos.Neos/Classes/Fusion/Helper/LinkHelper.php index 8d8bd9ca8c8..ee37e635dad 100644 --- a/Neos.Neos/Classes/Fusion/Helper/LinkHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/LinkHelper.php @@ -119,7 +119,7 @@ public function resolveNodeUri( ) { $this->systemLogger->info(sprintf( 'Failed to build URI for node "%s": %e', - $targetNode->nodeAggregateId, + $targetNode->nodeAggregateId->value, $e->getMessage() ), LogEnvironment::fromMethodName(__METHOD__)); return null; diff --git a/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php b/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php index 6eb6432a1da..22571437bcc 100644 --- a/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php @@ -68,9 +68,9 @@ public function nearestContentCollection(Node $node, string $nodePath): Node . ' You might want to adjust your node type configuration and create the missing child node' . ' through the "flow node:repair --node-type %s" command.', $contentCollectionType, - $nodePathOfNode, + $nodePathOfNode->value, $nodePath, - $node->nodeType + $node->nodeType->name->value ), 1389352984); } } diff --git a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php index 6f2cdd9da5a..b68638890f4 100644 --- a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php +++ b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php @@ -145,7 +145,7 @@ protected function resolveLabelFromNodeType(): void $this->label = $this->node->nodeType->getName(); } - if (empty($this->postfix) && $this->node->classification->isTethered()) { + if (empty($this->postfix) && $this->node->nodeName !== null && $this->node->classification->isTethered()) { $this->postfix = ' (' . $this->node->nodeName->value . ')'; } } diff --git a/Neos.Neos/Classes/PendingChangesProjection/Change.php b/Neos.Neos/Classes/PendingChangesProjection/Change.php index 374f1d8507e..3e04fffbc04 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/Change.php +++ b/Neos.Neos/Classes/PendingChangesProjection/Change.php @@ -96,7 +96,7 @@ public function addToDatabase(Connection $databaseConnection, string $tableName) 'changed' => (int)$this->changed, 'moved' => (int)$this->moved, 'deleted' => (int)$this->deleted, - 'removalAttachmentPoint' => $this->removalAttachmentPoint?->__toString() + 'removalAttachmentPoint' => $this->removalAttachmentPoint?->value ]); } @@ -108,7 +108,7 @@ public function updateToDatabase(Connection $databaseConnection, string $tableNa 'changed' => (int)$this->changed, 'moved' => (int)$this->moved, 'deleted' => (int)$this->deleted, - 'removalAttachmentPoint' => $this->removalAttachmentPoint?->__toString() + 'removalAttachmentPoint' => $this->removalAttachmentPoint?->value ], [ 'contentStreamId' => $this->contentStreamId->value, diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index f364ab36c22..c5d7bc6cedb 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -322,7 +322,7 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo 'nodeAggregateId' => $event->nodeAggregateId->value, 'originDimensionSpacePoint' => json_encode($occupiedDimensionSpacePoint), 'originDimensionSpacePointHash' => $occupiedDimensionSpacePoint->hash, - 'removalAttachmentPoint' => $event->removalAttachmentPoint?->__toString() + 'removalAttachmentPoint' => $event->removalAttachmentPoint?->value, ] ); } diff --git a/Neos.Neos/Classes/Presentation/Dimensions/VisualWeightedDimensionSpacePoint.php b/Neos.Neos/Classes/Presentation/Dimensions/VisualWeightedDimensionSpacePoint.php index 67622be59f1..fd326f3081f 100644 --- a/Neos.Neos/Classes/Presentation/Dimensions/VisualWeightedDimensionSpacePoint.php +++ b/Neos.Neos/Classes/Presentation/Dimensions/VisualWeightedDimensionSpacePoint.php @@ -14,6 +14,7 @@ namespace Neos\Neos\Presentation\Dimensions; +use Neos\ContentRepository\Core\Dimension\ContentDimensionValueSpecializationDepth; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\WeightedDimensionSpacePoint; use Neos\Flow\Annotations as Flow; @@ -45,8 +46,9 @@ public static function fromDimensionSpacePoint( int &$height ): self { $depth = 0; - foreach ($dimensionSpacePoint->weight->weight as $weight) { - $depth += $weight->depth; + /** @var ContentDimensionValueSpecializationDepth $weight */ + foreach ($dimensionSpacePoint->weight->value as $weight) { + $depth += $weight->value; } $previousY = $y; $y = $depth * 110 + 42; diff --git a/Neos.Neos/Classes/Service/View/NodeView.php b/Neos.Neos/Classes/Service/View/NodeView.php index a3b7f230f90..25f78833468 100644 --- a/Neos.Neos/Classes/Service/View/NodeView.php +++ b/Neos.Neos/Classes/Service/View/NodeView.php @@ -120,8 +120,8 @@ public function assignNodes(Nodes $nodes): void $this->systemLogger->info(sprintf( 'You have a node that is no longer connected to a document node ancestor.' . ' Name: %s (Identifier: %s)', - $node->nodeName, - $node->nodeAggregateId + $node->nodeName?->value, + $node->nodeAggregateId->value ), LogEnvironment::fromMethodName(__METHOD__)); } } diff --git a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php index 66e9c3f1b53..33a24f941f1 100644 --- a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php +++ b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php @@ -40,7 +40,7 @@ public function generateUriPathSegment(?Node $node = null, ?string $text = null) { $language = null; if ($node) { - $text = $text ?: $node->getLabel() ?: $node->nodeName->value; + $text = $text ?: $node->getLabel() ?: ($node->nodeName?->value ?? ''); $languageDimensionValue = $node->originDimensionSpacePoint->coordinates['language'] ?? null; if (!is_null($languageDimensionValue)) { $locale = new Locale($languageDimensionValue); diff --git a/Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php index 1c49ca761b9..d2885f59ed4 100644 --- a/Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php @@ -294,7 +294,7 @@ public function render(): string if ($resolvedNode === null) { $this->throwableStorage->logThrowable(new ViewHelperException(sprintf( 'Failed to resolve node "%s" on subgraph "%s"', - $nodeAddress->nodeAggregateId, + $nodeAddress->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601372444)); } @@ -311,7 +311,7 @@ public function render(): string } catch (NodeNotFoundException | InvalidShortcutException $e) { $this->throwableStorage->logThrowable(new ViewHelperException(sprintf( 'Failed to resolve shortcut node "%s" on subgraph "%s"', - $resolvedNode->nodeAggregateId, + $resolvedNode->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601370239, $e)); } @@ -391,7 +391,7 @@ private function resolveNodeAddressFromString( if ($siteNode === null) { throw new ViewHelperException(sprintf( 'Failed to determine site node for aggregate node "%s" and subgraph "%s"', - $documentNodeAddress->nodeAggregateId, + $documentNodeAddress->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601366598); } @@ -413,7 +413,7 @@ private function resolveNodeAddressFromString( throw new ViewHelperException(sprintf( 'Node on path "%s" could not be found for aggregate node "%s" and subgraph "%s"', $path, - $documentNodeAddress->nodeAggregateId, + $documentNodeAddress->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601311789); } diff --git a/Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php index f587bcfa931..6cdcb6350c5 100644 --- a/Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php @@ -294,7 +294,7 @@ private function resolveNodeAddressFromString(string $path): ?NodeAddress if ($siteNode === null) { throw new ViewHelperException(sprintf( 'Failed to determine site node for aggregate node "%s" and subgraph "%s"', - $documentNodeAddress->nodeAggregateId, + $documentNodeAddress->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601366598); } @@ -316,7 +316,7 @@ private function resolveNodeAddressFromString(string $path): ?NodeAddress $this->throwableStorage->logThrowable(new ViewHelperException(sprintf( 'Node on path "%s" could not be found for aggregate node "%s" and subgraph "%s"', $path, - $documentNodeAddress->nodeAggregateId, + $documentNodeAddress->nodeAggregateId->value, json_encode($subgraph, JSON_PARTIAL_OUTPUT_ON_ERROR) ), 1601311789)); return null;