V15: Dont create invalid media (#17534)

* Don't allow create when there is validation errors

* Fix tests

* Add tests

* Fix last test

* Fix more tests

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
This commit is contained in:
Nikolaj Geisle
2025-01-08 10:50:53 +01:00
committed by GitHub
parent c7b05d5455
commit b7f424756c
6 changed files with 74 additions and 2 deletions

View File

@@ -70,6 +70,8 @@ public abstract class UmbracoIntegrationTestWithMediaEditing : UmbracoIntegratio
var mediaTypes = MediaTypeService.GetAll();
var mediaTypesList = mediaTypes.ToList();
var imageMediaType = mediaTypesList.FirstOrDefault(x => x.Alias == "Image");
imageMediaType.PropertyTypes.First().Mandatory = false;
MediaTypeService.Save(imageMediaType);
// Add CustomMediaType to FolderMediaType AllowedContentTypes
var mediaTypeUpdateHelper = new MediaTypeUpdateHelper();