diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs index 6cb0addb71..183284d5b8 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs @@ -913,9 +913,9 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers v.Notifications.AddRange(n.Notifications); } + //lastly, if it is not valid, add the model state to the outgoing object and throw a 400 HandleInvalidModelState(display, cultureForInvariantErrors); - //lastly, if it is not valid, add the model state to the outgoing object and throw a 400 if (!ModelState.IsValid) { return ValidationProblem(display, ModelState); diff --git a/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs index d4aafe83ff..4b8fb6acb3 100644 --- a/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs @@ -68,6 +68,12 @@ namespace Umbraco.Cms.Web.BackOffice.Filters var model = (ContentItemSave) context.ActionArguments["contentItem"]; var contentItemValidator = new ContentSaveModelValidator(_loggerFactory.CreateLogger(), _propertyValidationService); + if (context.ModelState.ContainsKey("contentItem")) + { + // if the entire model is marked as error, remove it, we handle everything separately + context.ModelState.Remove("contentItem"); + } + if (!ValidateAtLeastOneVariantIsBeingSaved(model, context)) return; if (!contentItemValidator.ValidateExistingContent(model, context)) return; if (!await ValidateUserAccessAsync(model, context)) return;