We are upgrading our Sitecore instance from Sitecore 8.2 version to Sitecore 10.2 version, ORM used in Sitecore 8.2 is GlassMapper(v4.3.4.197)
.
We have upgraded glass mapper in Sitecore 10.2 via NuGet package manager.
In Sitecore 8.2 there was a custom field called Linked List
which is working fine with Glass Mapper, but after upgrading to Sitecore 10.2
, this field is showing an error while mapping.
The current site utilizes a custom link list field as instructed in the URL: http://code.monoco.se/2012/12/a-shiny-new-field-type-linklist/
Model class for glass mapper:
public partial class Footer : GlassBase
{
[SitecoreField(IFooterConstants.LinksFieldName)]
public virtual IEnumerable<Link> Links { get; set; }
}
View File for rendering file:
@foreach (var link in Model.Links)
{
<li>
@Html.Glass().RenderLink(link, x => x)
</li>
}
Post upgrading the glass mapper. we are getting the below exception for the link list field.
Glass.Mapper.MapperException: 'Failed to map field {51227AF0-F7B9-4930-8CF5-A4055FA69642} with value
<links><link text="About us" anchor="" linktype="internal" class="" title="About Us" target="" querystring=""
id="{B6B3EA62-37F4-4EB1-AD3B-33DEAFCFDCBA}" /><link text="Corporate responsibility" anchor="" linktype="internal" class=""
title="Corporate Responsibility" target="" querystring="" id="{AC469CBD-143E-458B-BFA9-10532835CCDD}" />
<link text="Diversity, equity and inclusion" anchor="" linktype="internal" class="" title="" target="" querystring=""
id="{0C437528-7C87-4F49-BEE1-4514A9A450BF}" /><links>