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?
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 :)
Descendants is only giving children
Hi all,
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:
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...