diff --git a/appveyor.yml b/appveyor.yml index 7ef177a..6f98288 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ # version format -version: 1.5.2.{build} +version: 1.5.3.{build} # UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha # example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta diff --git a/src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs b/src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs index 0c22772..052a1bf 100644 --- a/src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs +++ b/src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs @@ -93,12 +93,14 @@ private static T DoInnerGetVortoValue(this IPublishedContent content, string targetDataType.PropertyEditorAlias, content.ContentType); + var inPreviewMode = UmbracoContext.Current.InPreviewMode; + // Try convert data to source // We try this first as the value is stored as JSON not // as XML as would occur in the XML cache as in the act // of concerting to XML this would ordinarily get called // but with JSON it doesn't, so we try this first - var converted1 = properyType.ConvertDataToSource(value, false); + var converted1 = properyType.ConvertDataToSource(value, inPreviewMode); if (converted1 is T) return (T)converted1; var convertAttempt = converted1.TryConvertTo(); @@ -106,7 +108,7 @@ private static T DoInnerGetVortoValue(this IPublishedContent content, string // Try convert source to object // If the source value isn't right, try converting to object - var converted2 = properyType.ConvertSourceToObject(converted1, false); + var converted2 = properyType.ConvertSourceToObject(converted1, inPreviewMode); if (converted2 is T) return (T)converted2; convertAttempt = converted2.TryConvertTo(); diff --git a/src/Our.Umbraco.Vorto/Models/VortoValue.cs b/src/Our.Umbraco.Vorto/Models/VortoValue.cs index f62463d..ecc95c1 100644 --- a/src/Our.Umbraco.Vorto/Models/VortoValue.cs +++ b/src/Our.Umbraco.Vorto/Models/VortoValue.cs @@ -6,7 +6,7 @@ namespace Our.Umbraco.Vorto.Models { public class VortoValue { - internal VortoValue() + public VortoValue() { } [JsonProperty("values")] diff --git a/src/Our.Umbraco.Vorto/Web/UI/App_Plugins/Vorto/js/vorto.js b/src/Our.Umbraco.Vorto/Web/UI/App_Plugins/Vorto/js/vorto.js index add1131..82afec1 100644 --- a/src/Our.Umbraco.Vorto/Web/UI/App_Plugins/Vorto/js/vorto.js +++ b/src/Our.Umbraco.Vorto/Web/UI/App_Plugins/Vorto/js/vorto.js @@ -304,8 +304,11 @@ // Get the view path $scope.property.viewPath = umbPropEditorHelper.getViewPath(dataType.view); + // Get the property alias + var propAlias = $scope.model.propertyAlias || $scope.model.alias; + // Get the current properties datatype - vortoResources.getDataTypeByAlias(currentSection, nodeContext.contentTypeAlias, $scope.model.alias).then(function (dataType2) { + vortoResources.getDataTypeByAlias(currentSection, nodeContext.contentTypeAlias, propAlias).then(function (dataType2) { $scope.model.value.dtdGuid = dataType2.guid;