From 8ccbe4c1e48b6352e4726536b326d5fcd1f97f44 Mon Sep 17 00:00:00 2001 From: Niels Hartvig Date: Sat, 3 Jun 2017 17:34:31 +0200 Subject: [PATCH] Adds support for keys in package content --- src/Umbraco.Core/Services/PackagingService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index fbf3a7ee8f..874ec8d9fa 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -285,6 +285,7 @@ namespace Umbraco.Core.Services var nodeName = element.Attribute("nodeName").Value; var path = element.Attribute("path").Value; var template = element.Attribute("template").Value; + var key = element.Attribute("key") != null ? Guid.Parse(element.Attribute("key").Value) : Guid.Empty; var properties = from property in element.Elements() where property.Attribute("isDoc") == null @@ -302,6 +303,11 @@ namespace Umbraco.Core.Services SortOrder = int.Parse(sortOrder) }; + // update the Guid (for UDI support) + if (key != Guid.Empty) { + content.Key = key; + } + foreach (var property in properties) { string propertyTypeAlias = isLegacySchema ? property.Attribute("alias").Value : property.Name.LocalName;