Merge pull request #5173 from kjac/v8-fix-create-content-type-with-template
V8: YSOD when creating the same content type twice (mapping issue)
This commit is contained in:
@@ -246,7 +246,13 @@ namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
var templates = _fileService.GetTemplates(source.AllowedTemplates.ToArray());
|
||||
target.AllowedTemplates = source.AllowedTemplates
|
||||
.Select(x => context.Mapper.Map<EntityBasic>(templates.SingleOrDefault(t => t.Alias == x)))
|
||||
.Select(x =>
|
||||
{
|
||||
var template = templates.SingleOrDefault(t => t.Alias == x);
|
||||
return template != null
|
||||
? context.Mapper.Map<EntityBasic>(template)
|
||||
: null;
|
||||
})
|
||||
.WhereNotNull()
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user