Skip to content

Commit

Permalink
Merge pull request #5134 from umbraco/v8/bugfix/image-cropper-converter
Browse files Browse the repository at this point in the history
The ImageCropperPropertyValueEditor doesn't convert values in ConvertDbToString correctly
  • Loading branch information
Warren Buckley authored Jun 27, 2019
2 parents 80ffd02 + db867c6 commit ef19633
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ public override string ConvertDbToString(PropertyType propertyType, object value
// more magic here ;-(
var configuration = dataTypeService.GetDataType(propertyType.DataTypeId).ConfigurationAs<ImageCropperConfiguration>();
var crops = configuration?.Crops ?? Array.Empty<ImageCropperConfiguration.Crop>();
return "{src: '" + val + "', crops: " + crops + "}";

return JsonConvert.SerializeObject(new
{
src = val,
crops = crops
});
}
}
}

0 comments on commit ef19633

Please sign in to comment.