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 d0c8836b1a..1cf99b74a6 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 @@ -200,27 +200,28 @@ $scope.page.buttonGroupState = "busy"; - return contentEditingHelper.contentEditorPerformSave({ - saveMethod: args.saveMethod, - scope: $scope, - content: $scope.content, - action: args.action - }).then(function (data) { - //success - init($scope.content); - syncTreeNode($scope.content, data.path); + return contentEditingHelper.contentEditorPerformSave({ + saveMethod: args.saveMethod, + scope: $scope, + content: $scope.content, + action: args.action + }).then(function(data) { + //success + init($scope.content); + syncTreeNode($scope.content, data.path); - $scope.page.buttonGroupState = "success"; + $scope.page.buttonGroupState = "success"; + return $q.when(data); + }, + function(err) { + //error + if (err) { + editorState.set($scope.content); + } - }, function (err) { - //error - if (err) { - editorState.set($scope.content); - } - - $scope.page.buttonGroupState = "error"; - return $q.reject(err); - }); + $scope.page.buttonGroupState = "error"; + return $q.reject(err); + }); } function resetLastListPageNumber(content) { @@ -303,17 +304,18 @@ variants: $scope.content.variants, //set a model property for the dialog skipFormValidation: true, //when submitting the overlay form, skip any client side validation submitButtonLabel: "Publish", - submit: function (model) { + submit: function(model) { model.submitButtonState = "busy"; //we need to return this promise so that the dialog can handle the result and wire up the validation response return performSave({ saveMethod: contentResource.publish, action: "publish" - }).then(function () { + }).then(function(data) { overlayService.close(); + return $q.when(data); }, - function (err) { + function(err) { model.submitButtonState = "error"; //re-map the dialog model since we've re-bound the properties dialog.variants = $scope.content.variants; @@ -323,9 +325,10 @@ //will need to fix validation errors on the properties if (err.data && err.data.ModelState) { var keys = _.keys(err.data.ModelState); - var foundVariantError = _.find(keys, function(k) { - return k.startsWith("publish_variant_"); - }); + var foundVariantError = _.find(keys, + function(k) { + return k.startsWith("publish_variant_"); + }); if (!foundVariantError) { //no variant errors, close the dialog overlayService.close(); @@ -335,7 +338,7 @@ return $q.reject(err); }); }, - close: function (oldModel) { + close: function(oldModel) { overlayService.close(); } }; diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index fa384d92e8..dde6e2e612 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -69,6 +69,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica }); args.scope.busy = false; + return $q.when(data); }, function (err) { self.handleSaveError({ diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/boolean.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/boolean.controller.js index a7bf0ac280..7b848a107d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/boolean.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/boolean.controller.js @@ -1,4 +1,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.BooleanController", function ($scope) { + if ($scope.model.value === 1 || $scope.model.value === "1" || $scope.model.value === true) { + $scope.model.value = "1"; + } $scope.htmlId = "bool-" + String.CreateGuid(); }); diff --git a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs index 7ef2e6eb52..6c768f4932 100644 --- a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs @@ -7,7 +7,8 @@ namespace Umbraco.Web.PropertyEditors /// /// Represents a media picker property editor. /// - [DataEditor(Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "mediapicker", ValueTypes.Text, Group = "media", Icon = "icon-picture")] + [DataEditor(Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, + "Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = "media", Icon = "icon-picture")] public class MediaPickerPropertyEditor : DataEditor { ///