|
21 | 21 | use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; |
22 | 22 | use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds; |
23 | 23 | use Neos\ContentRepository\Core\SharedModel\Node\NodeName; |
| 24 | +use Neos\ContentRepository\Core\SharedModel\Node\PropertyName; |
24 | 25 | use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; |
25 | 26 | use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; |
26 | 27 | use Neos\Flow\Annotations as Flow; |
@@ -73,13 +74,26 @@ public function apply(RootTemplate $template, NodeCreationCommands $commands, No |
73 | 74 | $template->getProperties() |
74 | 75 | ); |
75 | 76 |
|
| 77 | + $propertyValuesToWrite = PropertyValuesToWrite::fromArray( |
| 78 | + $this->propertiesProcessor->processAndValidateProperties($node, $processingErrors) |
| 79 | + ); |
| 80 | + |
| 81 | + if (count($defaultPropertiesToUnset = iterator_to_array($propertyValuesToWrite->getPropertiesToUnset()))) { |
| 82 | + // FIXME workaround for https://github.com/neos/neos-development-collection/issues/5154 |
| 83 | + $setDefaultPropertiesToNull = SetNodeProperties::create( |
| 84 | + $commands->first->workspaceName, |
| 85 | + $commands->first->nodeAggregateId, |
| 86 | + $commands->first->originDimensionSpacePoint, |
| 87 | + PropertyValuesToWrite::fromArray( |
| 88 | + array_fill_keys(array_map(fn (PropertyName $name) => $name->value, $defaultPropertiesToUnset), null) |
| 89 | + ) |
| 90 | + ); |
| 91 | + $commands = $commands->withAdditionalCommands($setDefaultPropertiesToNull); |
| 92 | + } |
| 93 | + |
76 | 94 | $initialProperties = $commands->first->initialPropertyValues; |
77 | 95 |
|
78 | | - $initialProperties = $initialProperties->merge( |
79 | | - PropertyValuesToWrite::fromArray( |
80 | | - $this->propertiesProcessor->processAndValidateProperties($node, $processingErrors) |
81 | | - ) |
82 | | - ); |
| 96 | + $initialProperties = $initialProperties->merge($propertyValuesToWrite); |
83 | 97 |
|
84 | 98 | $initialProperties = $this->ensureNodeHasUriPathSegment( |
85 | 99 | $nodeType, |
|
0 commit comments