Fixes: U4-7691 7.4 beta - Document composition is not working with media types
Media type compositions weren't getting added since it only looked up through the content type service.
This commit is contained in:
@@ -69,7 +69,12 @@ namespace Umbraco.Web.Models.Mapping
|
||||
foreach (var a in add)
|
||||
{
|
||||
//TODO: Remove N+1 lookup
|
||||
var addCt = applicationContext.Services.ContentTypeService.GetContentType(a);
|
||||
//since we don't really know from the alias what type of content type this is,
|
||||
//we look up by content type first and then by media type if not found.
|
||||
//content type aliases are unique so this should be safe to do.
|
||||
IContentTypeComposition addCt = applicationContext.Services.ContentTypeService.GetContentType(a);
|
||||
if (addCt == null)
|
||||
addCt = applicationContext.Services.ContentTypeService.GetMediaType(a);
|
||||
if (addCt != null)
|
||||
dest.AddContentType(addCt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user