!!! FEATURE: Subtree Tags#4659
Merged
bwaidelich merged 59 commits into9.0from Mar 15, 2024
Merged
Conversation
…gateWasEnabled" events
…e/4550-subtree-tags
With #4076 the `ContentSubgraph` was adjusted to use the Doctrine DBAL QueryBuilder. This change adjusts the `ContentGraph` implementation accordingly # Conflicts: # Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
bwaidelich
commented
Mar 14, 2024
bwaidelich
commented
Mar 14, 2024
bwaidelich
commented
Mar 14, 2024
bwaidelich
commented
Mar 14, 2024
mhsdesign
reviewed
Mar 15, 2024
| * @param \Closure(SubtreeTag): mixed $callback | ||
| * @return array<mixed> | ||
| */ | ||
| public function map(\Closure $callback): array |
Member
There was a problem hiding this comment.
Im just wondering if your pr readme is outdated, because
$node->tags->map(fn (SubtreeTag $tag, bool $isInherited) => $this->outputLine(' - %s', [$isInherited ? $tag->value : '<b>' . $tag->value . '</b>']));
doesnt seem to work?
And also i was also wondering why we return a string array if we already have toStringArray
Member
Author
There was a problem hiding this comment.
Node::tags is a NodeTags instance, not a SubtreeTags
Member
There was a problem hiding this comment.
Ah okay sorry thanks, my brain still holds the old state in memory will have too pull :)
mhsdesign
reviewed
Mar 15, 2024
|
|
||
| public function getIterator(): \Traversable | ||
| { | ||
| return new \ArrayIterator(array_values($this->tags)); |
Member
There was a problem hiding this comment.
btw we agreed on using yield from $array in these cases ^^
Member
Author
There was a problem hiding this comment.
Ah right, feel free to fix!
6 tasks
bwaidelich
added a commit
that referenced
this pull request
Mar 19, 2024
This is a follow-up to the Subtree Tags introduction (#4659) that removes the now unsued `VisibilityConstraints::isDisabledContentShown()` *Note:* The implementation of this method was incorrect but instead of fixing that I decided to remove it since we should no longer rely on this and instead refer to the public `VisibilityConstraints::tagConstraints` field Related #4550
mhsdesign
added a commit
to mhsdesign/neos-development-collection
that referenced
this pull request
Dec 10, 2024
…d spread around This overhauls the `NodeAggregateWasDisabled` upcasting from neos#4659
neos-bot
pushed a commit
to neos/contentrepository-core
that referenced
this pull request
Dec 12, 2024
…d spread around This overhauls the `NodeAggregateWasDisabled` upcasting from neos/neos-development-collection#4659
mhsdesign
added a commit
to mhsdesign/neos-development-collection
that referenced
this pull request
Mar 5, 2025
… handling With Neos 9 Beta 8 the generic concept of subtree tags was introduced: neos#4659 Disabling publishes since then `SubtreeWasTagged`. The duplicated command implementation will be removed with Neos 9 Beta 19 and its now discouraged to use these legacy commands which now translate fully to their subtree counterparts.
6 tasks
neos-bot
pushed a commit
to neos/contentrepository-core
that referenced
this pull request
Mar 5, 2025
… handling With Neos 9 Beta 8 the generic concept of subtree tags was introduced: neos/neos-development-collection#4659 Disabling publishes since then `SubtreeWasTagged`. The duplicated command implementation will be removed with Neos 9 Beta 19 and its now discouraged to use these legacy commands which now translate fully to their subtree counterparts.
neos-bot
pushed a commit
to neos/neos
that referenced
this pull request
Mar 5, 2025
… handling With Neos 9 Beta 8 the generic concept of subtree tags was introduced: neos/neos-development-collection#4659 Disabling publishes since then `SubtreeWasTagged`. The duplicated command implementation will be removed with Neos 9 Beta 19 and its now discouraged to use these legacy commands which now translate fully to their subtree counterparts.
This file contains hidden or 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
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.
This change introduces the concept of Subtree Tags.
Concept
This change allows arbitrary so called Subtree Tags to be attached to nodes.
They are called Subtree Tags because they are always inherited to all descendant nodes.
That makes it possible to attach recursive information to any node which will be an important requirement for security related features but can also be used for other tasks, e.g. related to rendering.
Constraints and properties
/^[a-z0-9_.-]{1,36}$/)disabledtag that leads to the affected nodes to be excluded from subgraph queries in the frontendNoderead model exposes its tags including the information whether it is an inherited tagUsage
Add a subtree tag
Remove a subtree tag
Read tags
Breaking change
This is a breaking change mainly because it extends the
NodeandAggregateread models.Also the
NodeHiddenStateprojection (and itsNodeHiddenStateFinder) were replaced, see neos/neos-ui#3741A projection replay is not required because the deprecated
NodeAggregateWasDisabledandNodeAggregateWasEnabledevents are automatically up-casted!Custom projections might have to be reworked if they handled those events!
Next steps
On it's own, this new feature does not bring a whole lot of value (apart from replacing the overly complex restriction edges and the somewhat hacky NodeHiddenStateProjection).
But it will be the foundation for the Neos 9.0 security framework
Resolves: #4550
Related: #3732
Related: neos/neos-ui#3741