Umbraco 13 media picker validation
a
In Umbraco 13, the media picker has some server-side validation to check whether a media has been selected if the property is marked as mandatory. When the user clicks the Save and publish button, a call is made to the
/umbraco/backoffice/umbracoapi/content/PostSave
, and part of the response looks like this:
Copy code
json
{
  ...
  "ModelState": {
    "_Properties.image2.invariant.null.value": [
      "Value cannot be empty"
    ]
  }
  ...
}
Anyone know where this validation is handled? I haven't been able to find it anywhere in the code related to the media picker.
a
Great spot 👍 Now I just need to figure out why required validation doesn't work for my custom media picker (which extends
MediaPicker3PropertyEditor
😮
28 Views