-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! TASK: Remove Node::nodeType
#5021
!!! TASK: Remove Node::nodeType
#5021
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks for taking care!
But since this is a breaking change that will affect most installations, we should make sure that we have
- A proper description with explanations on how to migrate code
- Rector migration for Fusion code
- Rector migration for PHP code
And IMO we should have those in place before we merge this one – at least the first one :)
28d4087
to
8427f12
Compare
8427f12
to
5727464
Compare
a2f9300
to
437f842
Compare
The `NodeTypeManager` must be asked instead. For Neos' fallback logic the `NodeTypeWithFallbackProvider` can be used.
b02f61b
to
afbff5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, all according to plan!
Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
Show resolved
Hide resolved
The nodetype is also still used in https://github.com/neos/neos-development-collection/blob/9.0/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php#L93. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Requires #5020 in the long termWith #4466 the fallback NodeType handling was removed from the core NodeType manager and extracted to Neos. See the trait
NodeTypeWithFallbackProvider
.That required to make the
nodeType
field nullable on the NodeType.This pr takes it a bit further by fully removing the attached NodeType schema from the Node.
The Node attached
NodeType
was declared as deprecated with Neos9-Beta10.Resolves: #5019
Upgrade instructions
In Fusion accessing the
NodeType
via${node.nodeType}
wont work longer but one can leverage the helper${Neos.Node.getNodeType(node)}
to access the NodeType.To get the
NodeType
for aNode
in PHP, one can either use theNode::nodeTypeName
and ask theNeos\ContentRepository\Core\NodeType\NodeTypeManager::getNodeType
:For just accessing the string of the NodeType name you can consult the
Node
directly:Also note that
getNodeType
was made nullable by removing the default fallback. changeTo restore this behaviour you can use the
Neos\Neos\Utility\NodeTypeWithFallbackProvider
trait which will return a NodeType instance for any Node considering the Fallback (theNeos.Neos:FallbackNode
) in case the requested NodeType was removed. Please note that this behaviour is discouraged in favour of using nullable NodeTypes:Review instructions
Followup
node.nodeType
viewhelper for fluid (see also #5023)Rector migrations will be provided as part of neos/rector#57
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions