From 6028cebc906bfcb5997d4453204d40811dc552a4 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Fri, 7 Jun 2013 02:45:06 -1000 Subject: [PATCH] Fixes lookup for getting allowed child content types --- src/Umbraco.Web/Editors/ContentTypeApiController.cs | 8 ++++++-- src/Umbraco.Web/Models/Mapping/ContentTypeModelMapper.cs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Editors/ContentTypeApiController.cs b/src/Umbraco.Web/Editors/ContentTypeApiController.cs index 039603169f..6be37be81f 100644 --- a/src/Umbraco.Web/Editors/ContentTypeApiController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeApiController.cs @@ -44,8 +44,12 @@ namespace Umbraco.Web.Editors { throw new HttpResponseException(HttpStatusCode.NotFound); } - return Services.ContentTypeService.GetContentTypeChildren(contentItem.ContentTypeId) - .Select(x => _contentTypeModelMapper.ToContentItemBasic(x)); + + + return contentItem.ContentType.AllowedContentTypes + .Select(x => Services.ContentTypeService.GetContentType(x.Id.Value)) + .Select(x => _contentTypeModelMapper.ToContentTypeBasic(x)); + } } } \ No newline at end of file diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapper.cs index 214fc87e7b..168217b473 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapper.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Models.Mapping _applicationContext = applicationContext; } - public ContentTypeBasic ToContentItemBasic(IContentType contentType) + public ContentTypeBasic ToContentTypeBasic(IContentType contentType) { return new ContentTypeBasic {