mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing exceptions in MenuPartHandler
--HG-- branch : 1.x
This commit is contained in:
@@ -19,8 +19,11 @@ namespace Orchard.Core.Navigation.Handlers {
|
|||||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||||
var part = context.ContentItem.As<MenuPart>();
|
var part = context.ContentItem.As<MenuPart>();
|
||||||
|
|
||||||
if (part != null && context.ContentItem.TypeDefinition.Settings["Stereotype"] == "MenuItem") {
|
if (part != null) {
|
||||||
context.Metadata.DisplayText = part.MenuText;
|
string stereotype;
|
||||||
|
if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") {
|
||||||
|
context.Metadata.DisplayText = part.MenuText;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user