#19205: Fixing bug where menu items with same texts and urls, but under different parents, were treated as equal and merged into one.

Work Item: 19205

--HG--
branch : 1.x
This commit is contained in:
Piotr Szmyd
2012-12-14 05:21:24 +01:00
parent 8d8c53be2d
commit 06625c20fd

View File

@@ -36,6 +36,18 @@ namespace Orchard.UI.Navigation {
return false;
}
if (!string.IsNullOrWhiteSpace(x.Position) && !string.IsNullOrWhiteSpace(y.Position)) {
var xLastDot = x.Position.LastIndexOf('.');
var yLastDot = y.Position.LastIndexOf('.');
var xParentPosition = xLastDot == -1 ? null : x.Position.Substring(0, xLastDot);
var yParentPosition = yLastDot == -1 ? null : y.Position.Substring(0, yLastDot);
if (!string.Equals(xParentPosition, yParentPosition))
{
return false;
}
}
return true;
}