The method FindSiteMapNode of SiteMapProvider is not working correctly when the StartingNodeUrl is specified by a SiteMapDatasource.
In order to correct this bug we altered the code as shown bellow.
This issue needs to be resolved though in a future release. Don' t you think so?
public override SiteMapNode FindSiteMapNode(string rawUrl)
{
// If url is rewritten, that means that virtual page is used and when page node is not null
if (ClientContext.Context.IsUrlReWritten && HttpContext.Current.Items["PageNode"] != null)
{
SiteNode node = (SiteNode)HttpContext.Current.Items["PageNode"]; // GetNode("p_" + CommonHelper.GetRelativeUrl(rawUrl));
//if (node.Ancestors != null && node.Ancestors.Length > 0)
// return CreateSiteMapNode(node.Ancestors[0]);
//else
if (node == null)
return null;
return CreateSiteMapNode(node);
}
else
{
//object cidObject = HttpContext.Current.Request.QueryString["cid"];
//object idObject = HttpContext.Current.Request.QueryString["id"];
//Nortech
object cidObject = null;
object idObject = null;
if (rawUrl.Contains("StartingNodeUrl_"))
{
string []str;
str = rawUrl.Split(',','.');
if (str!=null)
cidObject = str[1];
}
else
{
cidObject = HttpContext.Current.Request.QueryString["cid"];
idObject = HttpContext.Current.Request.QueryString["id"];
}
if (cidObject != null)
{
return CreateSiteMapNode(GetNode("c_" + cidObject.ToString()));
}
else if (idObject != null)
{
return CreateSiteMapNode(GetNodeFromProduct(idObject.ToString()));
}
. . .
Nortech