We upgraded Glass Mapper version from 4.2.1.190
to 5.4.21.0
.
In our model, we are using [SitecoreChildren(InferType = true)]
to get the child items. For few of the child items, language fallback is disabled and they do not have any version in target languag say en-us. So we want to display only the items which has atleast one version. This was working fine in Glass Mapper 4 but after upgrading to Glass Mapper 5 we observed that SitecoreChildren
is listing out the items even if the version count is 0
and language fallback is disabled.
Also, Enforce Language Fallback
is disabled.
Models:
public class Product
{
[SitecoreField(FieldName = "Image List")]
public virtual ImageList ImageListItem { get; set; }
}
public class ImageList
{
[SitecoreChildren(InferType = true)]
public virtual IEnumerable<ImagesComponent> Images { get; set; }
}
View:
@model ImageList
foreach(var image in model.Images)
{
--logic --
}
Am I missing any setting that needs to be changes in Glass Mapper 5?