-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
!!! FEATURE: Separate properties from references in NodeType declaration #4677
Conversation
How do we want to continue here? I think i remember that this change caused some trouble in the neos ui, as we need to handle somehow the reference editors. You proposed this syntax, which i like as it resembles this approach: #4631 (comment) And we already the node type constraint: My.NodeType:
references:
regularRef: {}
singleRef:
constraints:
valueReference:
maxValue: 1 Maybe About the validation in the commands: We can easily enforce this invariant as the command will not merge the references but replace them. Otherwise we would get into trouble when merging two workspaces. But as said we can simply assert that the to be set references are allowed by the max value. Regarding the neos ui: We must decide whether it will be easy to implement real references and distinct between properties, or if we should still communicate towards the ui in the legacy format. Something else i remember from our discussions, which i wanted to document: We want to limit in the nodeType to have either a property or a reference per name. Even-though the escr could technically handle a property and reference with the same name, it makes things in the Ui and other places more complex without real benefit. We discussed to validate this in the construction of the NodeType ( |
I'd prefer |
- added `hasReference` - __legacyPropertyType used to ensure that the FlowQuery property operation will return the node directly but not an array of nodes - remove type "reference" or "references" in php doc documentation - use `hasReference` instead of `getPropertyType === reference`
That way the post processors are forced to be adjusted to work with the new format and will stop working for reference like property types The inspector.dataTypes.references? configuration was removed as references are special types. The `NodeReferenceConverter` was removed as it is out of use.
I got the ui to work again after i continued to split the properties and references. The adjustments for the ui can be found here: neos/neos-ui#3668 |
d8dfd02
to
c1a3f46
Compare
While it was noble to use the new |
This is ready to be reviewed :D (in combination with the ui neos/neos-ui#3668 change) moved to #4981 |
The constructor is @internal and thus we dont have to validate it too strongly.
…y as single reference and return the first (only) node instead of an array
5013a77
to
c375d51
Compare
Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
Outdated
Show resolved
Hide resolved
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.
Neos ui e2e pass locally and together with the ui adjustments the node creation handle also works
Will merge this now as agreed in the weekly and with bernhard.
Related #4549
Separates property and reference declaration by introducing a dedicated
references
section:The above is a one to one replacement for
Upgrade instructions
This pr is made backwards compatible in that the declaration of
reference
properties are still allowed and will be handled at runtime.The nodetype contains a breaking change, as the
references
are not any longer available viagetProperties
andgetPropertyType
.For theses usecases
getReferences
andhasReference
were introduced.Accessing
getPropertyType
is unsafe for references and will throw:The code must be changed to:
Existing Neos 9 projects using the legacy property-like declaration syntax AND the new features like reference
constraints
orproperties
must be migrated to the new syntax with this change.Checklist
Ui part: neos/neos-ui#3668
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions