Skip to content

Commit

Permalink
BUGFIX: Use aggregate dimensionspacepoint hash placeholder for fetchi…
Browse files Browse the repository at this point in the history
…ng changes for aggregates
  • Loading branch information
dlubitz committed Oct 24, 2024
1 parent 4fe6b98 commit c8f13d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Neos.Neos/Classes/PendingChangesProjection/Change.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/
final class Change
{
public const AGGREGATE_DIMENSIONSPACEPOINT_HASH_PLACEHOLDER = 'AGGREGATE';

/**
* @param NodeAggregateId|null $removalAttachmentPoint {@see RemoveNodeAggregate::$removalAttachmentPoint} for docs
*/
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c8f13d3

Please sign in to comment.