Fixes wiring up server validation when creating content

This commit is contained in:
Shannon
2018-08-13 12:11:08 +10:00
parent 5bd74f90aa
commit e950914fc8
2 changed files with 4 additions and 6 deletions

View File

@@ -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();
}
});
}

View File

@@ -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);