I recently upgraded a site from v6.1.6 to v7.1.8. I started seeing some weirdness on some of my pages and eventually found that something I was depending on in v6.1.6 had changed behavior.
Specifically, I was using AncestorsOrSelf to get a collection of the nodes above the current page that were not of a particular document type and was then taking the last member of the collection.
This would give me the document type of ancestor node closest to the current page that was not of type "DateFolder".
After upgrading to v7.1.8 this same line of code always returned the root node; in other words the node farthest away from the current page. If I changed the code to the following I got the closest node:
Ignoring for a moment the fact that I shouldn't have been depending on the default order of the collection and should have been explicitly ordering by level, was this a known change somewhere between the v6.1.6 and v7.1.8?
Thanks for the reply. I realize I wasn't clear on what my issue was.
The syntax using nodeTypeAlias works; it's just that the order of the items in the collection appears to have changed from v6.1.6 to v7.1.8. Whereas before I had to use .Last(), I'm now having to use .First().
AncestorsOrSelf Order of Collection Members
I recently upgraded a site from v6.1.6 to v7.1.8. I started seeing some weirdness on some of my pages and eventually found that something I was depending on in v6.1.6 had changed behavior.
Specifically, I was using AncestorsOrSelf to get a collection of the nodes above the current page that were not of a particular document type and was then taking the last member of the collection.
This would give me the document type of ancestor node closest to the current page that was not of type "DateFolder".
After upgrading to v7.1.8 this same line of code always returned the root node; in other words the node farthest away from the current page. If I changed the code to the following I got the closest node:
Ignoring for a moment the fact that I shouldn't have been depending on the default order of the collection and should have been explicitly ordering by level, was this a known change somewhere between the v6.1.6 and v7.1.8?
Thanks!
Hi Wayne,
If I remember correctly then the nodeTypeAlias is changed to DocumentTypeAlias, in Umbraco 7.
What if you do something like this does this do what you want.
Hope this helps,
/Dennis
Dennis,
Thanks for the reply. I realize I wasn't clear on what my issue was.
The syntax using nodeTypeAlias works; it's just that the order of the items in the collection appears to have changed from v6.1.6 to v7.1.8. Whereas before I had to use .Last(), I'm now having to use .First().
Wayne
is working on a reply...