Added option for filtering the content types allowed as children based on the parent node #18380
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.
Prerequisites
Resolves issue raised in discussion: #16329 (reply in thread)
Description
We discussed and introduced a server-side replacement for "sending allowed children notification" in 15.2, via this PR, but it had a bit of a design flaw for use for a typical use case where you want to allow only a certain number of items of content of a given type to be created.
We made available the parent document type to the filter, but not the parent content item. So when filtering allowed types under a given item, you didn't have the details of that item available.
I've resolved with this PR but it needed a bit more update than the previous, as we need to pass the detail of which item we are creating under up to the method that retrieves the allowed children, and where the filtering occurs.
To Test:
I've used and registered the following example to verify and test this, that can be adapted for other use cases: