Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit d211de9

Browse files
committed
cleanup the blueprint immediately, when validation errors occur
1 parent 41e1914 commit d211de9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
252252
if ($scope.model.node && $scope.model.node.id > 0) {
253253
// delete any temporary blueprints used for validation
254254
contentResource.deleteBlueprint($scope.model.node.id);
255+
256+
// set current node id, so subsequent deletes, giving 404 errors is avoided
257+
$scope.model.node.id = 0;
255258
}
256259

257260
//clear server validation messages when this editor is destroyed
@@ -280,9 +283,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
280283
contentEditingHelper.contentEditorPerformSave(args).then(function (data) {
281284
$scope.model.submit($scope.model);
282285
},
283-
function (err) {
284-
285-
});
286+
function (err) {
287+
// cleanup the blueprint immediately
288+
cleanup();
289+
});
286290
}
287291
}
288292
function close() {

0 commit comments

Comments
 (0)