-
-
Notifications
You must be signed in to change notification settings - Fork 241
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When executing a node migration with the transformation "ChangeNodeType" on a Document-NodeType it throws an error that ContentCollections are not an allowed child node for the new document, even if they specify a child node 'main' with that type.
If you set the option forceDeleteNonMatchingChildren: true it works as intended and does not delete the ContentCollection, but it would be preferable to not have to set that for every node migration that includes Document-NodeTypes.
It seems the process of transforming correctly checks for named child nodes (like 'main'), but the check beforehand only checks if a NodeType is generally allowed as a childNode of the NodeType you're migrating to.
Expected Behavior
The check before the ChangeNodeType-Transformation should correctly check for named child nodes when it tries to determine if a child node is allowed in the new NodeType.
Steps To Reproduce
I guess it is also reproducable in other ways, but the easiest for me was to install an fresh Neos (ddev) with the neos/demo SitePackage.
Then I added a new NodeType:
'Neos.Demo:Document.Page2':
superTypes:
'Neos.Demo:Document.Page': true
ui:
label: 'Page 2'
prototype(Neos.Demo:Document.Page2) < prototype(Neos.Demo:Document.Page)
And a simple NodeMigration:
comments: 'Test Migration'
migration:
- filters:
- type: 'NodeType'
settings:
nodeType: 'Neos.Demo:Document.Page'
transformations:
- type: 'ChangeNodeType'
settings:
newType: 'Neos.Demo:Document.Page2'
If you try to run the migration the following error is thrown:
Comments
Test Migration
Node type "Neos.Demo:Collection.Content.Main" is not allowed for child nodes of type Neos.Demo:Document.Page2
Type: Neos\ContentRepository\Core\SharedModel\Exception\NodeConstraintException
Code: 1707561400
File: Packages/Libraries/neos/contentrepository-core/Classes/Feature/Common/Const
raintChecks.php
Line: 340
Environment
- Flow: 9.1.0
- Neos: 9.1.1
- PHP: 8.3.27Anything else?
No response