From c5752b5db5d4bad82726ca104b6bbf033b01f275 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 11 Aug 2021 14:50:39 +0200 Subject: [PATCH] Revert "Fixed issue with saving content when having an empty variant. Aligned codebase with how it is in v8" This reverts commit 5ae0b64b365797f5ff9c6052edef71bfa40413c2. --- .../Controllers/ContentController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs index 54adef04fa8e..6cb0addb719a 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs @@ -913,9 +913,14 @@ private async Task> PostSaveInternal(ContentIte 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); + } + if (wasCancelled) { AddCancelMessage(display);