diff --git a/src/umbraco.cms/businesslogic/Content.cs b/src/umbraco.cms/businesslogic/Content.cs index ad9d992d07..9d80511bca 100644 --- a/src/umbraco.cms/businesslogic/Content.cs +++ b/src/umbraco.cms/businesslogic/Content.cs @@ -699,11 +699,13 @@ namespace umbraco.cms.businesslogic continue; //get the propertyId - var property = propData - .Where(x => x.PropertyTypeId == pt.Id) - .SingleOrDefault(); + var property = propData.SingleOrDefault(x => x.PropertyTypeId == pt.Id); if (property == null) - continue; + { + //continue; + var prop = Property.MakeNew(pt, this, Version); + property = new { Id = prop.Id, PropertyTypeId = pt.Id }; + } var propertyId = property.Id; Property p = null; diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 5d79309f4a..93275ccdfe 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -1468,6 +1468,7 @@ where published = 1 And nodeId = @nodeId And trashed = 0", SqlHelper.CreateParam { //copy file if it's an upload property (so it doesn't get removed when original doc get's deleted) + IDataType tagsField = new Factory().GetNewObject(new Guid("4023e540-92f5-11dd-ad8b-0800200c9a66")); IDataType uploadField = new Factory().GetNewObject(new Guid("5032a6e6-69e3-491d-bb28-cd31cd11086c")); if (p.PropertyType.DataTypeDefinition.DataType.Id == uploadField.Id @@ -1491,6 +1492,16 @@ where published = 1 And nodeId = @nodeId And trashed = 0", SqlHelper.CreateParam } } + else if (p.PropertyType.DataTypeDefinition.DataType.Id == tagsField.Id && + p.Value.ToString() != "") + { + //Find tags from the original and add them to the new document + var tags = Tags.Tag.GetTags(this.Id); + foreach (var tag in tags) + { + Tags.Tag.AddTagsToNode(newDoc.Id, tag.TagCaption, tag.Group); + } + } else { newDoc.getProperty(p.PropertyType.Alias).Value = p.Value;