Handle unpublished, non-variant content
This commit is contained in:
@@ -48,7 +48,7 @@ public abstract class ContentMapDefinition<TContent, TPropertyViewModel, TVarian
|
||||
{
|
||||
IPropertyValue[] propertyValues = source.Properties.SelectMany(propertyCollection => propertyCollection.Values).ToArray();
|
||||
var cultures = source.AvailableCultures.DefaultIfEmpty(null).ToArray();
|
||||
var segments = propertyValues.Select(property => property.Segment).Distinct().ToArray();
|
||||
var segments = propertyValues.Select(property => property.Segment).Distinct().DefaultIfEmpty(null).ToArray();
|
||||
|
||||
return cultures
|
||||
.SelectMany(culture => segments.Select(segment =>
|
||||
|
||||
@@ -17,7 +17,6 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentProp
|
||||
public void DefineMaps(IUmbracoMapper mapper)
|
||||
=> mapper.Define<IContent, DocumentViewModel>((_, _) => new DocumentViewModel(), Map);
|
||||
|
||||
// TODO: handle unpublished, non-variant content
|
||||
// Umbraco.Code.MapAll
|
||||
private void Map(IContent source, DocumentViewModel target, MapperContext context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user