(I'm using Sitecore 8.1 Update 3 with Glass Mapper.Sc version 4.1.1.66)
I've run into an issue where some of the properties of a Sitecore item are not being populated in code through Glass Mapper. The values in our Content Base item (Id, Name, Display Name, typical Sitecore fields) seem to be getting populated correctly, but the child item's fields (I'll call it Overview) aren't mapped at all. They're all strings but they all end up null, even though the Content Base's values look to be correct. We also have child class maps working in other areas of the same, so that may not be the cause here.
Earlier in this project, we had an issue with Glass Mapper where field names that included spaces were not being read. However, I've made sure to leave out any spaces in field names, but this doesn't solve the issue.
Another possible contributor to the issue is that we have multiple languages on the site, so it's conceivable that language fallback may be complicating things. However, we have fallback enabled and working properly across the site without issues. (EDIT: I have tried applying the VersionCountDisabler, but that didn't help.)
I can post code if needed, but for the most part, it's just POCO's and mapping classes.
Any ideas on what other parts I should be looking into?
EDIT: Adding code
Mapping class:
namespace TheProject.Sc.Feature.Asset.Model.Configuration
{
[ExcludeFromCodeCoverage]
public class IAssetOverviewModelMap : SitecoreGlassMap<IAssetOverviewModel>
{
public override void Configure()
{
Map(config =>
{
ImportMap<IContentBase>();
config.AutoMap();
config.Field(f => f.HeaderPrefix).FieldName("AssetOverviewContentHeaderPrefix");
config.Field(f => f.MarkUnitUnavailableText).FieldName("AssetOverviewContentMarkUnitUnavailableText");
config.Field(f => f.PdfButtonText).FieldName("AssetOverviewContentPdfButtonText");
config.Field(f => f.EditRecordButtonText).FieldName("AssetOverviewContentEditRecordButtonText");
config.Field(f => f.SaveButtonText).FieldName("AssetOverviewContentSaveButtonText");
});
}
}
}
And here's a working mapping, which is called above and does just fine.:
namespace TheProject.Sc.Foundation.Model.Configuration
{
public class IContentBaseMap : SitecoreGlassMap<IContentBase>
{
public override void Configure()
{
Map(config =>
{
config.AutoMap();
config.Id(m => m.Id);
config.Info(m => m.Name).InfoType(SitecoreInfoType.Name);
config.Info(m => m.DisplayName).InfoType(SitecoreInfoType.DisplayName);
config.Info(m => m.Path).InfoType(SitecoreInfoType.Path);
config.Info(m => m.Url).InfoType(SitecoreInfoType.Url);
config.Info(m => m.FullPath).InfoType(SitecoreInfoType.FullPath);
config.Info(m => m.TemplateName).InfoType(SitecoreInfoType.TemplateName);
config.Info(m => m.TemplateId).InfoType(SitecoreInfoType.TemplateId);
config.Field(f => f.Sortorder).FieldName("__Sortorder"); // This line always returns 0, even when Sortorder is set differently
});
}
}
}