We have moved to GitHub Issues
Created by Rune Strand 11 Jan 2016, 14:18:15 Updated by Stephan 10 Feb 2016, 13:40:47
Relates to: U4-7891
What did you do? I uploaded some images to the Media Library and then added a new crop to the Image Cropper data type (which is the standard upload for 7.4)
What did you expect to happen? I expected to be able to use a media picker and then render the image using the crop:
var image = Umbraco.Media(item.image); <img src="@image.GetCropUrl("promoHome")">
What actually happened?
An empty string is returned because the new crop definition has not been saved on the media item. If I go to the Media Library and save the image the crop information is updated and the image is rendered as it should be.
This is being marked as a breaking changed because:
PropertyValueConverteris required for the ImageCropper which now makes the default value a
JObjectinstead of a
GetCropUrlbecause that uses this to get the value:
mediaItem.GetPropertyValue<string>which just does a ToString() on JObject which results in the json string anyways
If developers are using either:
//this will now cause an exception since it's returning a JObject (string)mediaItem.GetPropertyValue("image") //this will return null because it's returning a JObject mediaItem.GetPropertyValue("image") as string
They will need to update their usages.
PR for review: https://github.com/umbraco/Umbraco-CMS/pull/1056
Code looks good and confirmed its working.
Priority: Task - Pri 1
Backwards Compatible: False
Affected versions: 7.4.0
Due in version: 7.4.0
Sprint: Sprint 7