|
151 | 151 |
|
152 | 152 | $scope.setPreview = function (model) {
|
153 | 153 | if ($scope.control.editor.config && "enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
|
154 |
| - var activeVariant = editorState.current.variants.find(v => v.active); |
155 |
| - var culture = activeVariant ? activeVariant.language.culture : null; |
| 154 | + var activeVariant = editorState.current.variants?.find(v => v.active); |
| 155 | + var culture = activeVariant?.language?.culture; |
156 | 156 | dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id,
|
157 | 157 | $scope.control.editor.alias, model.dtgeContentTypeAlias, model.value,
|
158 | 158 | $scope.control.editor.config.viewPath,
|
@@ -252,6 +252,9 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
|
252 | 252 | if ($scope.model.node && $scope.model.node.id > 0) {
|
253 | 253 | // delete any temporary blueprints used for validation
|
254 | 254 | 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; |
255 | 258 | }
|
256 | 259 |
|
257 | 260 | //clear server validation messages when this editor is destroyed
|
@@ -280,9 +283,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
|
280 | 283 | contentEditingHelper.contentEditorPerformSave(args).then(function (data) {
|
281 | 284 | $scope.model.submit($scope.model);
|
282 | 285 | },
|
283 |
| - function (err) { |
284 |
| - |
285 |
| - }); |
| 286 | + function (err) { |
| 287 | + // cleanup the blueprint immediately |
| 288 | + cleanup(); |
| 289 | + }); |
286 | 290 | }
|
287 | 291 | }
|
288 | 292 | function close() {
|
@@ -383,6 +387,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
|
383 | 387 | });
|
384 | 388 | }
|
385 | 389 |
|
| 390 | + if (dtgeUtilityService.compareCurrentUmbracoVersion("8.7.0", {}) && !$("body").hasClass("pre870")) { |
| 391 | + $("body").addClass("pre870"); |
| 392 | + }; |
| 393 | + |
386 | 394 | }
|
387 | 395 |
|
388 | 396 | ]);
|
0 commit comments