diff --git a/Neos.Neos/Classes/PendingChangesProjection/Change.php b/Neos.Neos/Classes/PendingChangesProjection/Change.php index 7b616e47b6c..0fb47251d20 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/Change.php +++ b/Neos.Neos/Classes/PendingChangesProjection/Change.php @@ -30,6 +30,8 @@ */ final class Change { + public const AGGREGATE_DIMENSIONSPACEPOINT_HASH_PLACEHOLDER = 'AGGREGATE'; + /** * @param NodeAggregateId|null $removalAttachmentPoint {@see RemoveNodeAggregate::$removalAttachmentPoint} for docs */ @@ -57,7 +59,7 @@ public function addToDatabase(Connection $databaseConnection, string $tableName) 'contentStreamId' => $this->contentStreamId->value, 'nodeAggregateId' => $this->nodeAggregateId->value, 'originDimensionSpacePoint' => $this->originDimensionSpacePoint?->toJson(), - 'originDimensionSpacePointHash' => $this->originDimensionSpacePoint?->hash ?: 'AGGREGATE', + 'originDimensionSpacePointHash' => $this->originDimensionSpacePoint?->hash ?: self::AGGREGATE_DIMENSIONSPACEPOINT_HASH_PLACEHOLDER, 'created' => (int)$this->created, 'changed' => (int)$this->changed, 'moved' => (int)$this->moved, diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 1544b774835..1d173895789 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -555,10 +555,11 @@ private function getChangeForAggregate( 'SELECT n.* FROM ' . $this->tableNamePrefix . ' n WHERE n.contentStreamId = :contentStreamId AND n.nodeAggregateId = :nodeAggregateId -AND n.origindimensionspacepointhash = NULL', +AND n.origindimensionspacepointhash = :origindimensionspacepointhash', [ 'contentStreamId' => $contentStreamId->value, 'nodeAggregateId' => $nodeAggregateId->value, + 'origindimensionspacepointhash' => Change::AGGREGATE_DIMENSIONSPACEPOINT_HASH_PLACEHOLDER ] )->fetchAssociative();