diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/04-NodeModification/01-SetNodeProperties_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/04-NodeModification/01-SetNodeProperties_ConstraintChecks.feature index 968798de225..24a22c54ebf 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/04-NodeModification/01-SetNodeProperties_ConstraintChecks.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/04-NodeModification/01-SetNodeProperties_ConstraintChecks.feature @@ -67,7 +67,7 @@ Feature: Set node properties: Constraint checks | Key | Value | | nodeAggregateId | "lady-eleonode-rootford" | | originDimensionSpacePoint | {"language":"de"} | - | propertyValues | {} | + | propertyValues | {"text":"New text"} | Then the last command should have thrown an exception of type "NodeAggregateIsRoot" Scenario: Try to set properties in an origin dimension space point that does not exist diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php index bb978e7e948..0972da056b3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php @@ -48,6 +48,9 @@ private function __construct( public OriginDimensionSpacePoint $originDimensionSpacePoint, public PropertyValuesToWrite $propertyValues, ) { + if ($this->propertyValues->isEmpty()) { + throw new \InvalidArgumentException(sprintf('The command "SetNodeProperties" for node %s must contain property values', $this->nodeAggregateId->value), 1733394351); + } } /** diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/PropertyValuesToWrite.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/PropertyValuesToWrite.php index dcc0f414f3c..b27d956d5f5 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/PropertyValuesToWrite.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/PropertyValuesToWrite.php @@ -95,4 +95,9 @@ public function getPropertiesToUnset(): PropertyNames ) ); } + + public function isEmpty(): bool + { + return $this->values === []; + } }