diff --git a/src/Umbraco.Core/Models/ContentType.cs b/src/Umbraco.Core/Models/ContentType.cs index 355d724fbe..7219230bc2 100644 --- a/src/Umbraco.Core/Models/ContentType.cs +++ b/src/Umbraco.Core/Models/ContentType.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Serialization; +using Umbraco.Core.Configuration; namespace Umbraco.Core.Models { @@ -34,6 +35,10 @@ namespace Umbraco.Core.Models [Obsolete("This method is obsolete, use ContentType(IContentType parent, string alias) instead.", false)] public ContentType(IContentType parent) : this(parent, null) { + if (UmbracoConfig.For.UmbracoSettings().Content.EnableInheritedDocumentTypes) + { + AddContentType(parent); + } } /// @@ -45,6 +50,10 @@ namespace Umbraco.Core.Models public ContentType(IContentType parent, string alias) : base(parent, alias) { + if (UmbracoConfig.For.UmbracoSettings().Content.EnableInheritedDocumentTypes) + { + AddContentType(parent); + } _allowedTemplates = new List(); } diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 4622fee1b5..d0c6c32d67 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Web.Http; @@ -11,6 +12,7 @@ using Umbraco.Core.Services; using Umbraco.Core.PropertyEditors; using System.Net.Http; using Umbraco.Core; +using Umbraco.Core.Configuration; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; @@ -184,7 +186,18 @@ namespace Umbraco.Web.Editors /// public ContentTypeDisplay GetEmpty(int parentId) { - var ct = new ContentType(parentId); + IContentType ct = null; + if (UmbracoConfig.For.UmbracoSettings().Content.EnableInheritedDocumentTypes && + parentId != Constants.System.Root) + { + var parent = Services.ContentTypeService.GetContentType(parentId); + ct = new ContentType(parent, String.Empty); + } + else + { + ct = new ContentType(parentId); + } + ct.Icon = "icon-document"; var dto = Mapper.Map(ct);