mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
Fixing exceptions in MenuPartHandler
--HG-- branch : 1.x
This commit is contained in:
@@ -19,9 +19,12 @@ 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) {
|
||||||
|
string stereotype;
|
||||||
|
if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") {
|
||||||
context.Metadata.DisplayText = part.MenuText;
|
context.Metadata.DisplayText = part.MenuText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user