diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index a47a3125c9..b26ec26d60 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -461,7 +461,7 @@ syncTreeNode($scope.content, data.path, false, args.reloadChildren); - eventsService.emit("content.saved", { content: $scope.content, action: args.action }); + eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: true }); resetNestedFieldValiation(fieldsToRollback); ensureDirtyIsSetIfAnyVariantIsDirty(); @@ -470,11 +470,14 @@ }, function (err) { - //needs to be manually set for infinite editing mode - $scope.page.isNew = false; syncTreeNode($scope.content, $scope.content.path); + if (err.status === 400 && err.data) { + // content was saved but is invalid. + eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: false }); + } + resetNestedFieldValiation(fieldsToRollback); return $q.reject(err);