Ensure a media type correctly inherits it's selected parent
This commit is contained in:
committed by
Sebastiaan Janssen
parent
84e4c78bb9
commit
28dd9aa081
@@ -145,9 +145,18 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
public MediaTypeDisplay GetEmpty(int parentId)
|
||||
{
|
||||
var ct = new MediaType(parentId) {Icon = "icon-picture"};
|
||||
IMediaType mt;
|
||||
if (parentId != Constants.System.Root)
|
||||
{
|
||||
var parent = Services.ContentTypeService.GetMediaType(parentId);
|
||||
mt = parent != null ? new MediaType(parent, string.Empty) : new MediaType(parentId);
|
||||
}
|
||||
else
|
||||
mt = new MediaType(parentId);
|
||||
|
||||
var dto = Mapper.Map<IMediaType, MediaTypeDisplay>(ct);
|
||||
mt.Icon = "icon-picture";
|
||||
|
||||
var dto = Mapper.Map<IMediaType, MediaTypeDisplay>(mt);
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user