From e950914fc8561b3c45b9fd1d5a8d2e974ede2a0b Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 13 Aug 2018 12:11:08 +1000 Subject: [PATCH] Fixes wiring up server validation when creating content --- .../directives/components/content/edit.controller.js | 9 +++------ .../src/views/content/content.delete.controller.js | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) 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 6b80ca8a2c..fbe92963ed 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 @@ -211,11 +211,6 @@ init($scope.content); - //in one particular special case, after we've created a new item we redirect back to the edit - // route but there might be server validation errors in the collection which we need to display - // after the redirect, so we will bind all subscriptions which will show the server validation errors. - serverValidationManager.notify(); - if (!infiniteMode) { syncTreeNode($scope.content, data.path, true); } @@ -637,7 +632,9 @@ } //since we are not notifying and clearing server validation messages when they are received due to how the variant //switching works, we need to ensure they are cleared when this editor is destroyed - serverValidationManager.clear(); + if (!$scope.page.isNew) { + serverValidationManager.clear(); + } }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js index 6e2865046d..356e056533 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js @@ -38,6 +38,7 @@ function ContentDeleteController($scope, $timeout, contentResource, treeService, //ensure the recycle bin has child nodes now var recycleBin = treeService.getDescendantNode(rootNode, -20); if (recycleBin) { + //TODO: This seems to return a rejection and we end up with "Possibly unhanded rejection" treeService.syncTree({ node: recycleBin, path: treeService.getPath(recycleBin), forceReload: true }); } }, 500);