diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index 32e33cc35e..4d842a1dd6 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -842,10 +842,19 @@ namespace Umbraco.Core.Services } else { - _logger.Warn( - string.Format( - "Packager: Error handling DocumentType structure. DocumentType with alias '{0}' could not be found and was not added to the structure for '{1}'.", - alias, contentType.Alias)); + // DocumentType was not in imported or dependant types, try to get from ContentTypeService + var allowedChild = _contentTypeService.GetContentType(alias); + if (allowedChild == null) + { + _logger.Warn( + string.Format( + "Packager: Error handling DocumentType structure. DocumentType with alias '{0}' could not be found and was not added to the structure for '{1}'.", + alias, contentType.Alias)); + } + if (allowedChildren.Any(x => x.Id.IsValueCreated && x.Id.Value == allowedChild.Id)) continue; + + allowedChildren.Add(new ContentTypeSort(new Lazy(() => allowedChild.Id), sortOrder, allowedChild.Alias)); + sortOrder++; } }