Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrailsford committed Nov 1, 2016
2 parents d4a4911 + e418954 commit 16c4137
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,22 @@ private static T DoInnerGetVortoValue<T>(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<T>();
if (convertAttempt.Success) return convertAttempt.Result;

// 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<T>();
Expand Down
2 changes: 1 addition & 1 deletion src/Our.Umbraco.Vorto/Models/VortoValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Our.Umbraco.Vorto.Models
{
public class VortoValue
{
internal VortoValue()
public VortoValue()
{ }

[JsonProperty("values")]
Expand Down
5 changes: 4 additions & 1 deletion src/Our.Umbraco.Vorto/Web/UI/App_Plugins/Vorto/js/vorto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 16c4137

Please sign in to comment.