We have moved to GitHub Issues
Created by Mads Rasmussen 02 Feb 2017, 14:18:44 Updated by Emil Wangaa 21 Feb 2017, 08:01:06
Relates to: U4-9545
Is required for: U4-7385
Subtask of: U4-9272
Needs API change in GetChildren to know if each node has children
Items, each has a
PersistedContent.HasChildren() method but the result is not exposed in the API call. It doesn't seem that there's a property that can be set to get that bool out.
Anything we can do here @Shandem ?
PersistedContent is used internally for inbound mapping, it has nothing to do with the outgoing model - i'll add more notes. However, that wouldn't solve the problem anyways.
IContent doesn't contain a reference to whether it has children or not, you'd need to make a Service call to get that but then you'll end up with N+1 queries and performance will die.
The EntityService/EntityController supports HasChildren, and we cannot update the ContentService to have this because to do this is another outer join and then another aggregate Count which would really kill performance for looking up a full content item.
This needs to be refactored to use the EntityController since the data returned is really just an Id + name + icon, a whole content item and it's properties doesn't need to be returned. Otherwise a whole new ContentService method needs to be made to determine if there are children for a subset of IDs, this would require a bit of (unecessary) work.
PR for review: https://github.com/umbraco/Umbraco-CMS/pull/1755
@madsrasmussen and @emil could both review this, changes made:
EntityController.GetPagedChildrenwhich supports the same mechanisms as the Content/Media controller's
GetChildrenmethod including searching/filtering
publishedproperties based on the result item's
metaDataproperty which contains this info, then updated the html view to deal with these changes
For testing, ensure you test this with Media/Content/Members with search and with children of children. Works on my machine :)
@Shannon and @emil: I am still testing but I have found these issues so far:
I can help fix the unpublished media and the "nested list view indent"
@madsrasmussen sounds good, I can look at the 404 tomorrow, can you paste the URL that is returning the 404 here for me?
@Shandem I have updated the PR with my fixes. I havn't found any other issues from my testing. Client side code looks good and everything is nice and fast.
Sorry, it wasn't a 404 but 400: The URL is UmbracoApi/Entity/GetPagedChildren?id=all-members&type=Member&pageNumber=1&pageSize=10&orderBy=SortOrder&orderDirection=Ascending&filter=
@emil I will set the issue back to reopened but I still need your eyes on the server code.
@madsrasmussen + @emil I've pushed an update on this one to fix the members id 404/400 issue, it will now accept "all-members" as a node id (will treat it as -1 since members don't have a hierarchy), my tests show it works so please have a look :)
@Shandem I can't get it to work - maybe it's "just" a typo? Okay so the members doesn't have a hierarchy but we show the member types in the mini list view like in the tree in the members section - but that is maybe not possible?
@emil Ok, all fixed up and working, have tested the member mini list view with paging, all members and member types. Updating the entity service to support searching on member type will take too much work, so for now the entity service is used for paging/filtering all members but if we are filtering based on member type it reverts to using the Examine search, which has been updated to support paging. Also note that part of this PR fixes this too: http://issues.umbraco.org/issue/U4-9552
Yeah everything is working now - this is great :D
Backwards Compatible: True
Due in version: 7.6.0
Sprint: Sprint 53
Story Points: 1