Adds support for keys in package content

This commit is contained in:
Niels Hartvig
2017-06-03 17:34:31 +02:00
parent 4a735770e2
commit 8ccbe4c1e4

View File

@@ -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;