Issue with AddNode

Nov 14, 2010 at 10:38 PM

Hi Marteen!

You've this method:

        protected override void AddNode(SiteMapNode node, SiteMapNode parentNode)
        {
            try
            {
                // Avoid issue with url table not clearing correctly.
                if (base.FindSiteMapNode(node.Url) != null)
                {
                    if (parentNode != nullbase.RemoveNode(parentNode);
                    base.RemoveNode(node);
                }

                base.AddNode(node, parentNode);
            }
            catch (InvalidOperationException)
            {
                if (!isBuildingSiteMap)
                {
                    throw;
                }
            }
        }
My problem is that I've a list of downloadable documents, maybe they're pointing to the same url (which is not allowed, I get it!), so in AddNode you're removing to not to cause the base provider blow up. So far so good.
But if the given node has a parent...like "Downloads" - as in my case - why are you removing the parent node too? It makes my whole download section disappear...which is wrong, I think.
What am I missing here?
Thanks,
Attila
Nov 15, 2010 at 11:35 AM

This is a fix for cleaning the sitemap. I'll do an additional check in there.

Nov 15, 2010 at 11:36 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 15, 2010 at 11:36 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.