-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Open
mhsdesign
wants to merge
3
commits into
neos:9.0
Choose a base branch
from
mhsdesign:task/5019-remove-nodetype-from-node
base: 9.0
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bwaidelich
reviewed
Apr 30, 2024
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
5727464
to
a2f9300
Compare
The `NodeTypeManager` must be asked instead. For Neos' fallback logic the `NodeTypeWithFallbackProvider` can be used.
a2f9300
to
437f842
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires #5020 in the long term.
With #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.
Resolves partially #5019
Upgrade instructions
To get the
NodeType
for aNode
in PHP, one can either use theNode::nodeTypeName
and ask theNeos\ContentRepository\Core\NodeType\NodeTypeManager::getNodeType
:Or for the Neos use-case the
Neos\Neos\Utility\NodeTypeWithFallbackProvider
trait can be used, which will return a NodeType instance for any Node considering the Fallback (Neos.Neos:FallbackNode
) in case the NodeType was removed:In Fusion accessing the
NodeType
via${node.nodeType}
will currently no longer work (a translation layer is in conception: #5022) but one can leverage the helper${Neos.Node.getNodeType(node)}
to access the NodeType.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