From a58bf507edce54793fc8d06c9564c7ec088f136d Mon Sep 17 00:00:00 2001 From: Iurie Marchitan Date: Tue, 5 Apr 2016 10:33:36 +0200 Subject: [PATCH] Add error callback handler for unpublish event in content.edit.controller. For some cases user may not be allowed to unpublish a content, and he need to get a notification message that explains the reason. --- .../src/views/content/content.edit.controller.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js index e8e729fd72..43e71b38db 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js @@ -190,6 +190,15 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $ $scope.page.buttonGroupState = "success"; + }, function (err) { + $scope.page.buttonGroupState = "error"; + $scope.busy = false; + //show any notifications + if (angular.isArray(err.data.notifications)) { + for (var i = 0; i < err.data.notifications.length; i++) { + notificationsService.showNotification(err.data.notifications[i]); + } + } }); }