Lookup content root nodes when using MNTP in media and members section #10049
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
If there's an existing issue for this PR then this fixes #9917
Description
When using MNTP in media and member section it was throwing console errors, because
entityResource.getByQuery()
didn't return an enity as$routeParams.id
is the current node and when$site
and$root
in XPathentityResource.getByQuery()
query for a start node, but it couldn't find one in media and member because noDocument
had those ids - only when accessing MNTP in content section.Currently I am not sure how much we can do about that since it is possible to have muliple root/site nodes in content and editors/users may have different start nodes.
It seems
GetChildren
in EntityController handle this if start nodes have been configurated:https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/Editors/EntityController.cs#L483-L490
I tested when user has access to a different start node (site node), where it seems to be same behaviour:
But with "Ignore User Start Nodes" enabled on the datatype, which also seems to be same behaviour:
However if "Content Root" has been selected as start node or no start node is configurated and the entity controller only returns a single root node, it is rendered a bit nicer with the XPath expression.