Skip to content

Commit 9940b78

Browse files
author
Stephan
committed
U4-4575 - fix 8371105
1 parent 8371105 commit 9940b78

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Umbraco.Web/Models/PublishedProperty.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ internal static IEnumerable<IPublishedProperty> MapProperties(
5555
var v = p == null || p.Value == null ? null : p.Value;
5656
if (v != null)
5757
{
58-
var dataType = dataTypesResolver.DataTypes.SingleOrDefault(qq => qq.Id == x.PropertyEditorGuid);
58+
// note - not sure about the performance here
59+
var dataTypeDefinition = global::umbraco.cms.businesslogic.datatype.DataTypeDefinition
60+
.GetDataTypeDefinition(x.DataTypeId);
61+
var dataType = dataTypeDefinition.DataType;
5962
if (dataType != null)
6063
{
6164
var data = dataType.Data;
6265
data.Value = v;
6366
var n = data.ToXMl(new XmlDocument());
64-
v = n.InnerXml;
67+
if (n.NodeType == XmlNodeType.CDATA || n.NodeType == XmlNodeType.Text)
68+
v = n.InnerText;
69+
else if (n.NodeType == XmlNodeType.Element)
70+
v = n.InnerXml;
71+
// note - is there anything else we should take care of?
6572
}
6673
}
6774
// fixme - means that the IPropertyValueConverter will always get a string

0 commit comments

Comments
 (0)