Umbraco-CMS: Console error when opening media picker crop from grid

With latest changes I noticed some console errors, when opening image crop via media picker in the grid editor.

It seems scope.dimensions has some NaN values in its nested object properties, e.g. scale min and max.

image


This item has been added to our backlog AB#8321

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (15 by maintainers)

Most upvoted comments

It seems like you two are close to a solution so I’ll let you work on it for a bit more 👍

The coordinates property it only saved on the entity if media has been saved with crops, so existing medias might not have this property.

The data comes from entityResource.getPagedDescendants() https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js#L447

and entityResource.getChildren() https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js#L519

In the abobe json I have saved the “Unicorn” image with crops. Not sure if it is expected the response from server side is the following?

"coordinates": {
  "x1": null,
  "y1": null,
  "x2": null,
  "y2": null
}