This project is read-only.
1

Closed

Missing TitlePart

description

Hi,

For my Custom Types I don't use a TitlePart, I implement ITitleAspect. So when creating a new item, it'll crash on this line in AdvancedMenuItemPartDriver.cs

Text = string.Format( "{1}:\t{0}", x.As<TitlePart>().Title, x.ContentItem.TypeDefinition.DisplayName )

Since it'll fail the As conversion.

You should replace that line with.

Text = x.ContentItem.ContentManager.GetItemMetadata( x ).DisplayText,

as noted here by Bertrand
http://orchard.codeplex.com/discussions/311109



Cheers, Sarkie
Closed Apr 25, 2012 at 6:34 PM by pszmyd
Applied fix as suggested by @Sarkie. Fixed in changeset 579418de16ca.

comments

Sarkie wrote Apr 25, 2012 at 11:21 AM

Also noticed usage in
MenuAdminController,
BreadcrumbsPartDriver,
MenuRelationPartDriver,
RecentlySeenPartDriver

pszmyd wrote Apr 25, 2012 at 2:57 PM

Thanks for the info, will change that.

Sarkie wrote Apr 25, 2012 at 5:30 PM

Pretty sure you are meant to use the code I've suggested from here http://orchard.codeplex.com/discussions/311109 , instead of using .As<ITitleAspect> in case they change that interface in the future.