Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm upgrading a site from Umbraco 8.18 to 10.4 and I've run into an unusual problem. I have a page (ID 1493) with a hierarchical tree of business applications. In Umbraco 8 I'm using the following code snippet to get all apps:
var allApps = Umbraco.Content(1493).Descendants<App>();
However, if I use the same code in Umbraco 10.4 it only gets the children, not all the descendants. In fact, I can change .Descendants to .Children and it returns exactly the same data.
Maybe my brain's just fried at the moment, but what in the world am I doing wrong here? How do I get all the descendants, including subpages?
My opinion it should work can i see your umbraco content tree
Yes, should definitely work, does for me, although I am not using the typed <T> method, just .Descendants()
Figured it out, after some sleep :)
The missing descendants were all showing in the backoffice as "This document is published but is not in the cache". I just had to republish them and they all showed up.
Sorry for the confusion and thanks for trying to help :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted