Merge pull request #5134 from umbraco/v8/bugfix/image-cropper-converter

The ImageCropperPropertyValueEditor doesn't convert values in ConvertDbToString correctly
This commit is contained in:
Warren Buckley
2019-06-27 12:20:43 +01:00
committed by GitHub

View File

@@ -174,7 +174,12 @@ namespace Umbraco.Web.PropertyEditors
// 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
});
}
}
}