diff --git a/src/Umbraco.Core/Dynamics/PropertyResult.cs b/src/Umbraco.Core/Dynamics/PropertyResult.cs index 26bc475b6c..a4ba1cfb1c 100644 --- a/src/Umbraco.Core/Dynamics/PropertyResult.cs +++ b/src/Umbraco.Core/Dynamics/PropertyResult.cs @@ -31,19 +31,20 @@ namespace Umbraco.Core.Dynamics internal PropertyResultType PropertyType { get { return _type; } } - public string Alias { get { return _source == null ? _alias : _source.Alias; } } - public object RawValue { get { return _source == null ? _value : _source.RawValue; } } + public string PropertyTypeAlias { get { return _source == null ? _alias : _source.PropertyTypeAlias; } } + public object DataValue { get { return _source == null ? _value : _source.DataValue; } } public bool HasValue { get { return _source == null || _source.HasValue; } } - public object Value { get { return _source == null ? _value : _source.Value; } } - public object XPathValue { get { return Value == null ? null : Value.ToString(); } } + public object ObjectValue { get { return _source == null ? _value : _source.ObjectValue; } } + // fixme - is it OK to return null here? + public object XPathValue { get { return ObjectValue == null ? null : ObjectValue.ToString(); } } // implements IHtmlString.ToHtmlString public string ToHtmlString() { - // note - use RawValue here, because that's what the original + // note - use DataValue here, because that's what the original // Razor macro engine seems to do... - var value = RawValue; + var value = DataValue; return value == null ? string.Empty : value.ToString(); } } diff --git a/src/Umbraco.Core/Models/IPublishedProperty.cs b/src/Umbraco.Core/Models/IPublishedProperty.cs index 1b5813874f..9e67c60854 100644 --- a/src/Umbraco.Core/Models/IPublishedProperty.cs +++ b/src/Umbraco.Core/Models/IPublishedProperty.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Models /// /// Gets the alias of the property. /// - string Alias { get; } + string PropertyTypeAlias { get; } /// /// Gets a value indicating whether the property has a value. @@ -26,34 +26,34 @@ namespace Umbraco.Core.Models bool HasValue { get; } /// - /// Gets the raw value of the property. + /// Gets the data value of the property. /// /// - /// The raw value is whatever was passed to the property when it was instanciated, and it is + /// The data value is whatever was passed to the property when it was instanciated, and it is /// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented. /// The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache. - /// For other cachesthat get their raw value from the database, it would be either a string, + /// For other caches that get their raw value from the database, it would be either a string, /// an integer (Int32), or a date and time (DateTime). /// - object RawValue { get; } + object DataValue { get; } /// - /// Gets the value of the property. + /// Gets the object value of the property. /// /// /// The value is what you want to use when rendering content in an MVC view ie in C#. /// It can be null, or any type of CLR object. - /// It has been fully prepared and processed by the appropriate converters. + /// It has been fully prepared and processed by the appropriate converter. /// - object Value { get; } + object ObjectValue { get; } /// /// Gets the XPath value of the property. /// /// /// The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine. - /// It must be either null, or a non-empty string, or an XPathNavigator. - /// It has been fully prepared and processed by the appropriate converters. + /// It must be either null, or a string, or an XPathNavigator. + /// It has been fully prepared and processed by the appropriate converter. /// object XPathValue { get; } } diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentExtended.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentExtended.cs index eee3a194dd..37c9ab3203 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentExtended.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentExtended.cs @@ -131,8 +131,8 @@ namespace Umbraco.Core.Models.PublishedContent { if (_properties != null) { - var property = _properties.FirstOrDefault(prop => prop.Alias.InvariantEquals(alias)); - if (property != null) return property.HasValue ? property.Value : null; + var property = _properties.FirstOrDefault(prop => prop.PropertyTypeAlias.InvariantEquals(alias)); + if (property != null) return property.HasValue ? property.ObjectValue : null; } return Content[alias]; } @@ -142,7 +142,7 @@ namespace Umbraco.Core.Models.PublishedContent { return _properties == null ? Content.GetProperty(alias) - : _properties.FirstOrDefault(prop => prop.Alias.InvariantEquals(alias)) ?? Content.GetProperty(alias); + : _properties.FirstOrDefault(prop => prop.PropertyTypeAlias.InvariantEquals(alias)) ?? Content.GetProperty(alias); } #endregion diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs index ff8de68ff0..d19a79b149 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs @@ -17,15 +17,15 @@ namespace Umbraco.Core.Models.PublishedContent PropertyType = propertyType; } - public string Alias + public string PropertyTypeAlias { get { return PropertyType.PropertyTypeAlias; } } // these have to be provided by the actual implementation public abstract bool HasValue { get; } - public abstract object RawValue { get; } - public abstract object Value { get; } + public abstract object DataValue { get; } + public abstract object ObjectValue { get; } public abstract object XPathValue { get; } } } diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs index 2ee0fd2b2d..2703c83892 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs @@ -25,18 +25,21 @@ namespace Umbraco.Core.Models.PublishedContent DataTypeId = propertyType.DataTypeDefinitionId; PropertyEditorGuid = propertyType.DataTypeId; + //PropertyEditorAlias = propertyType.PropertyEditorAlias; InitializeConverters(); } // for unit tests internal PublishedPropertyType(string propertyTypeAlias, int dataTypeDefinitionId, Guid propertyEditorGuid) + //internal PublishedPropertyType(string propertyTypeAlias, int dataTypeDefinitionId, Alias propertyEditorAlias) { // ContentType to be set by PublishedContentType when creating it PropertyTypeAlias = propertyTypeAlias; DataTypeId = dataTypeDefinitionId; PropertyEditorGuid = propertyEditorGuid; + //PropertyEditorAlias = PropertyEditorAlias; InitializeConverters(); } @@ -59,9 +62,6 @@ namespace Umbraco.Core.Models.PublishedContent /// public int DataTypeId { get; private set; } - // note: in v6 a property editor is uniquely identified by a guid, whereas in v7 - // it is uniquely identified by a string alias // fixme - compat? - /// /// Gets or sets the guid uniquely identifying the property editor for the property type. /// @@ -70,7 +70,7 @@ namespace Umbraco.Core.Models.PublishedContent /// /// Gets or sets the alias uniquely identifying the property editor for the property type. /// - public string PropertyEditorAlias { get; private set; } + //public string PropertyEditorAlias { get; private set; } #endregion diff --git a/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs b/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs index d7ff2c2f94..f09db20db4 100644 --- a/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs +++ b/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs @@ -19,7 +19,7 @@ namespace Umbraco.Tests.CodeFirst foreach (var property in content.Properties) { - var @alias = property.Alias; + var @alias = property.PropertyTypeAlias; var propertyInfo = propertyInfos.FirstOrDefault(x => x.Name.ToUmbracoAlias() == @alias); if (propertyInfo == null) continue; @@ -27,12 +27,12 @@ namespace Umbraco.Tests.CodeFirst object value = null; //TODO Proper mapping of types if (propertyInfo.PropertyType == typeof(string)) - value = property.Value; + value = property.ObjectValue; else if (propertyInfo.PropertyType == typeof(DateTime)) - value = DateTime.Parse(property.Value.ToString()); + value = DateTime.Parse(property.ObjectValue.ToString()); else if (propertyInfo.PropertyType == typeof(Boolean)) { - if (String.IsNullOrEmpty(property.Value.ToString()) || property.Value == "0") + if (String.IsNullOrEmpty(property.ObjectValue.ToString()) || property.ObjectValue == "0") { value = false; } diff --git a/src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs b/src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs index b2ac31c91a..e8c03850a8 100644 --- a/src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs +++ b/src/Umbraco.Tests/PublishedCache/PublishedMediaCacheTests.cs @@ -243,11 +243,11 @@ namespace Umbraco.Tests.PublishedCache a => null, //we're not going to test this so ignore a => new List(), - (dd, a) => dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(a)), + (dd, a) => dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(a)), false), //callback to get the children d => children, - (dd, a) => dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(a)), + (dd, a) => dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(a)), false); return dicDoc; } diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index 945bf22c34..79ad0891ba 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs @@ -214,14 +214,14 @@ namespace Umbraco.Tests.PublishedContent public object this[string propertyAlias] { - get { return GetProperty(propertyAlias).RawValue; } // fixme - why not just .Value? + get { return GetProperty(propertyAlias).DataValue; } // fixme - why DataValue here? } public IEnumerable Children { get; set; } public IPublishedProperty GetProperty(string alias) { - return Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); + return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); } public IPublishedProperty GetProperty(string alias, bool recurse) diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index 3d7d12a45d..c51613b8b8 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -226,10 +226,10 @@ namespace Umbraco.Tests.PublishedContent { new SolidPublishedProperty { - Alias = "prop1", + PropertyTypeAlias = "prop1", HasValue = true, - Value = 1234, - RawValue = "1234" + ObjectValue = 1234, + DataValue = "1234" } } }); @@ -249,10 +249,10 @@ namespace Umbraco.Tests.PublishedContent { new SolidPublishedProperty { - Alias = "prop1", + PropertyTypeAlias = "prop1", HasValue = true, - Value = 1234, - RawValue = "1234" + ObjectValue = 1234, + DataValue = "1234" } } }); @@ -272,10 +272,10 @@ namespace Umbraco.Tests.PublishedContent { new SolidPublishedProperty { - Alias = "prop1", + PropertyTypeAlias = "prop1", HasValue = true, - Value = 1234, - RawValue = "1234" + ObjectValue = 1234, + DataValue = "1234" } } }); diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs index 437f5c003e..86b32b2d50 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs @@ -183,7 +183,7 @@ namespace Umbraco.Tests.PublishedContent public IPublishedProperty GetProperty(string alias) { - return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(alias)); + return Properties.FirstOrDefault(p => p.PropertyTypeAlias.InvariantEquals(alias)); } public IPublishedProperty GetProperty(string alias, bool recurse) @@ -206,7 +206,7 @@ namespace Umbraco.Tests.PublishedContent get { var property = GetProperty(alias); - return property == null || property.HasValue == false ? null : property.Value; + return property == null || property.HasValue == false ? null : property.ObjectValue; } } @@ -220,9 +220,9 @@ namespace Umbraco.Tests.PublishedContent // initialize boring stuff } - public string Alias { get; set; } - public object RawValue { get; set; } - public object Value { get; set; } + public string PropertyTypeAlias { get; set; } + public object DataValue { get; set; } + public object ObjectValue { get; set; } public bool HasValue { get; set; } public object XPathValue { get; set; } } diff --git a/src/Umbraco.Web/Models/DynamicPublishedContent.cs b/src/Umbraco.Web/Models/DynamicPublishedContent.cs index 6c38383490..38f36de240 100644 --- a/src/Umbraco.Web/Models/DynamicPublishedContent.cs +++ b/src/Umbraco.Web/Models/DynamicPublishedContent.cs @@ -177,7 +177,7 @@ namespace Umbraco.Web.Models { var reflectedProperty = GetReflectedProperty(binder.Name); var result = reflectedProperty != null - ? reflectedProperty.Value + ? reflectedProperty.ObjectValue : null; return Attempt.If(result != null, result); @@ -722,8 +722,8 @@ namespace Umbraco.Web.Models public string GetPropertyValue(string alias, bool recursive) { var property = GetProperty(alias, recursive); - if (property == null || property.Value == null) return null; - return property.Value.ToString(); + if (property == null || property.ObjectValue == null) return null; + return property.ObjectValue.ToString(); } #endif diff --git a/src/Umbraco.Web/Models/PublishedContentBase.cs b/src/Umbraco.Web/Models/PublishedContentBase.cs index 3db343c8db..c0a58ffbdf 100644 --- a/src/Umbraco.Web/Models/PublishedContentBase.cs +++ b/src/Umbraco.Web/Models/PublishedContentBase.cs @@ -47,7 +47,7 @@ namespace Umbraco.Web.Models var prop = GetProperty(Constants.Conventions.Media.File); if (prop == null) throw new NotSupportedException("Cannot resolve a Url for a media item when there is no 'umbracoFile' property defined."); - _url = prop.Value.ToString(); + _url = prop.ObjectValue.ToString(); break; default: throw new ArgumentOutOfRangeException(); @@ -144,7 +144,7 @@ namespace Umbraco.Web.Models { // no cache here: GetProperty should be fast, and .Value cache should be managed by the property. var property = GetProperty(alias); - return property == null ? null : property.Value; + return property == null ? null : property.ObjectValue; } } diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index 5090466d06..7650b7030d 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -322,14 +322,15 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache if (dd.LoadedFromExamine) { //if this is from Examine, lets check if the alias does not exist on the document - if (dd.Properties.All(x => x.Alias != alias)) + if (dd.Properties.All(x => x.PropertyTypeAlias != alias)) { //ok it doesn't exist, we might assume now that Examine didn't index this property because the index is not set up correctly //so before we go loading this from the database, we can check if the alias exists on the content type at all, this information //is cached so will be quicker to look up. - if (dd.Properties.Any(x => x.Alias == UmbracoContentIndexer.NodeTypeAliasFieldName)) + if (dd.Properties.Any(x => x.PropertyTypeAlias == UmbracoContentIndexer.NodeTypeAliasFieldName)) { - var aliasesAndNames = ContentType.GetAliasesAndNames(dd.Properties.First(x => x.Alias.InvariantEquals(UmbracoContentIndexer.NodeTypeAliasFieldName)).RawValue.ToString()); + // fixme - is it OK to use DataValue here? + var aliasesAndNames = ContentType.GetAliasesAndNames(dd.Properties.First(x => x.PropertyTypeAlias.InvariantEquals(UmbracoContentIndexer.NodeTypeAliasFieldName)).DataValue.ToString()); if (aliasesAndNames != null) { if (!aliasesAndNames.ContainsKey(alias)) @@ -346,7 +347,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache { media.MoveNext(); var mediaDoc = ConvertFromXPathNavigator(media.Current); - return mediaDoc.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); + return mediaDoc.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); } } } @@ -354,9 +355,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache //We've made it here which means that the value is stored in the Examine index. //We are going to check for a special field however, that is because in some cases we store a 'Raw' //value in the index such as for xml/html. - var rawValue = dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(UmbracoContentIndexer.RawFieldPrefix + alias)); + var rawValue = dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(UmbracoContentIndexer.RawFieldPrefix + alias)); return rawValue - ?? dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); + ?? dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); } /// diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs index c010f48d32..5bcca93da5 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs @@ -98,7 +98,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public override IPublishedProperty GetProperty(string alias) { - return Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); + return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); } // override to implement cache diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs index 55242e07b6..a75ea7c4a3 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs @@ -18,14 +18,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache { private readonly string _xmlValue; // the raw, xml node value private readonly Lazy _sourceValue; - private readonly Lazy _value; + private readonly Lazy _objectValue; private readonly Lazy _xpathValue; private readonly bool _isPreviewing; /// /// Gets the raw value of the property. /// - public override object RawValue { get { return _xmlValue; } } + public override object DataValue { get { return _xmlValue; } } // in the Xml cache, everything is a string, and to have a value // you want to have a non-null, non-empty string. @@ -34,7 +34,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache get { return _xmlValue.Trim().Length > 0; } } - public override object Value { get { return _value.Value; } } + public override object ObjectValue { get { return _objectValue.Value; } } public override object XPathValue { get { return _xpathValue.Value; } } public XmlPublishedProperty(PublishedPropertyType propertyType, bool isPreviewing, XmlNode propertyXmlData) @@ -60,7 +60,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache _isPreviewing = isPreviewing; _sourceValue = new Lazy(() => PropertyType.ConvertDataToSource(_xmlValue, _isPreviewing)); - _value = new Lazy(() => PropertyType.ConvertSourceToObject(_sourceValue.Value, _isPreviewing)); + _objectValue = new Lazy(() => PropertyType.ConvertSourceToObject(_sourceValue.Value, _isPreviewing)); _xpathValue = new Lazy(() => PropertyType.ConvertSourceToXPath(_sourceValue.Value, _isPreviewing)); } } diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs index 7623f6ef13..52e8c3fec1 100644 --- a/src/Umbraco.Web/PublishedContentExtensions.cs +++ b/src/Umbraco.Web/PublishedContentExtensions.cs @@ -206,7 +206,7 @@ namespace Umbraco.Web public static object GetPropertyValue(this IPublishedContent content, string alias) { var property = content.GetProperty(alias); - return property == null ? null : property.Value; + return property == null ? null : property.ObjectValue; } /// @@ -225,7 +225,7 @@ namespace Umbraco.Web public static object GetPropertyValue(this IPublishedContent content, string alias, string defaultValue) { var property = content.GetProperty(alias); - return property == null || property.HasValue == false ? defaultValue : property.Value; + return property == null || property.HasValue == false ? defaultValue : property.ObjectValue; } /// @@ -244,7 +244,7 @@ namespace Umbraco.Web public static object GetPropertyValue(this IPublishedContent content, string alias, object defaultValue) { var property = content.GetProperty(alias); - return property == null || property.HasValue == false ? defaultValue : property.Value; + return property == null || property.HasValue == false ? defaultValue : property.ObjectValue; } /// @@ -264,7 +264,7 @@ namespace Umbraco.Web public static object GetPropertyValue(this IPublishedContent content, string alias, bool recurse) { var property = content.GetProperty(alias, recurse); - return property == null ? null : property.Value; + return property == null ? null : property.ObjectValue; } /// @@ -285,7 +285,7 @@ namespace Umbraco.Web public static object GetPropertyValue(this IPublishedContent content, string alias, bool recurse, object defaultValue) { var property = content.GetProperty(alias, recurse); - return property == null || property.HasValue == false ? defaultValue : property.Value; + return property == null || property.HasValue == false ? defaultValue : property.ObjectValue; } #endregion @@ -1619,9 +1619,10 @@ namespace Umbraco.Web }; var userVals = new Dictionary(); - foreach (var p in from IPublishedProperty p in n.Properties where p.RawValue != null select p) + // fixme - is it OK to use DataValue here? + foreach (var p in from IPublishedProperty p in n.Properties where p.DataValue != null select p) { - userVals[p.Alias] = p.RawValue; // use the raw, unprocessed value + userVals[p.PropertyTypeAlias] = p.DataValue; // use the raw, unprocessed value } //add the row data Core.DataTableExtensions.AddRowData(tableData, standardVals, userVals); diff --git a/src/Umbraco.Web/PublishedContentPropertyExtension.cs b/src/Umbraco.Web/PublishedContentPropertyExtension.cs index ee4dd83e57..efcf4d6fb6 100644 --- a/src/Umbraco.Web/PublishedContentPropertyExtension.cs +++ b/src/Umbraco.Web/PublishedContentPropertyExtension.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web // else we use .Value so we give the converter a chance to handle the default value differently // eg for IEnumerable it may return Enumerable.Empty instead of null - var value = property.Value; + var value = property.ObjectValue; // if value is null (strange but why not) it still is OK to call TryConvertTo // because it's an extension method (hence no NullRef) which will return a diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index 107433a3c9..c441371377 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -363,9 +363,9 @@ namespace umbraco } // the legacy library returns the string value from the xml cache - which means a string - // that has not be converted at all -- use RawValue here. + // that has not be converted at all -- use DataValue here. var prop = doc.GetProperty(alias); - return prop == null ? string.Empty : prop.RawValue.ToString(); + return prop == null ? string.Empty : prop.DataValue.ToString(); } /// diff --git a/src/Umbraco.Web/umbraco.presentation/page.cs b/src/Umbraco.Web/umbraco.presentation/page.cs index 6fe510044e..b63317c577 100644 --- a/src/Umbraco.Web/umbraco.presentation/page.cs +++ b/src/Umbraco.Web/umbraco.presentation/page.cs @@ -273,9 +273,9 @@ namespace umbraco { foreach(var p in node.Properties) { - if (!_elements.ContainsKey(p.Alias)) + if (!_elements.ContainsKey(p.PropertyTypeAlias)) { - _elements[p.Alias] = p.Value; + _elements[p.PropertyTypeAlias] = p.ObjectValue; } } } diff --git a/src/umbraco.MacroEngines/RazorDynamicNode/PublishedContentExtensions.cs b/src/umbraco.MacroEngines/RazorDynamicNode/PublishedContentExtensions.cs index ad0b3c4b55..05f419d2e8 100644 --- a/src/umbraco.MacroEngines/RazorDynamicNode/PublishedContentExtensions.cs +++ b/src/umbraco.MacroEngines/RazorDynamicNode/PublishedContentExtensions.cs @@ -20,7 +20,7 @@ namespace umbraco.MacroEngines.Library { internal static IProperty ConvertToNodeProperty(this IPublishedProperty prop) { - return new PropertyResult(prop.Alias, prop.Value.ToString()); + return new PropertyResult(prop.PropertyTypeAlias, prop.ObjectValue.ToString()); } internal static INode ConvertToNode(this IPublishedContent doc)