Just wanted to check whether my expectations are set correctly...
AncestorsOrSelf(nodeTypeAlias) always returns the current node even if this node is not of type nodeTypeAlias. So it doesn't perform a check on type for the current node
On the other hand, AncestorOrSelf(nodeTypeAlias) will perform a check on alias even for the this node?
Do you think this is correct? Or do you consider this a bug
AncestorOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func) performs the check on every node including the current one.
AncestorsOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func) always adds the current node to the list without performing any test.
Still the case in the latest 6.1. I'd say it's a bug.
Me too, considering this a bug, but bit afraid it might break lots of implementations. But anyway, bugs should be fixed! I'm filing this on the issue tracker.
AncestorsOrSelf(nodeTypeAlias) vs AncestorOrSelf(nodeTypeAlias)
Hi guys,
Just wanted to check whether my expectations are set correctly...
AncestorsOrSelf(nodeTypeAlias) always returns the current node even if this node is not of type nodeTypeAlias. So it doesn't perform a check on type for the current node
On the other hand, AncestorOrSelf(nodeTypeAlias) will perform a check on alias even for the this node?
Do you think this is correct? Or do you consider this a bug
I'm expecting that
AncestorsOfSelf(IPublishedContent this, Func<IPublishedContent, bool> func)
would perform the check for the this node as well as it already does for AncestorOrSelf()?
Any thoughts?
Cheers,
/Dirk
Oh, i'm using v4.11.4, but have noticed this is still the same in v4.11.6 (Haven't checked v6+)
Cheers,
/Dirk
AncestorOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func) performs the check on every node including the current one.
AncestorsOrSelf(this IPublishedContent content, Func<IPublishedContent, bool> func) always adds the current node to the list without performing any test.
Still the case in the latest 6.1. I'd say it's a bug.
My idea also:
There are so many situations where you need access to all ancestors of a certain type including the current node IF ONLY it's of the same type.
Me too, considering this a bug, but bit afraid it might break lots of implementations. But anyway, bugs should be fixed! I'm filing this on the issue tracker.
Cheers,
/Dirk
Have a fix available. Will push as soon as I have some time.
Can you post the link to the issue here?
Not only for IPublishedContent, the same goes for DynamicNode.
@Stephen: Have filed a bug, so you can refer to this issue when pushing your fix: http://issues.umbraco.org/issue/U4-2117
Cheers,
/Dirk
is working on a reply...