From 93bb75511bd61351df100ccbdcc10e930a048ba6 Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Thu, 18 Jul 2019 13:09:12 +0100 Subject: [PATCH] Fixed #5907 by reloading content on bulk publish / unpublish Fixes #5907 --- .../listview/listview.controller.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index df7a574c49..9b4c01f4f9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -405,7 +405,7 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie }; $scope.publish = function () { - applySelected( + var attempt = applySelected( function (selected, index) { return contentResource.publishById(getIdCallback(selected[index])); }, function (count, total) { var key = (total === 1 ? "bulk_publishedItemOfItem" : "bulk_publishedItemOfItems"); @@ -415,10 +415,15 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie var key = (total === 1 ? "bulk_publishedItem" : "bulk_publishedItems"); return localizationService.localize(key, [total]); }); + if (attempt) { + attempt.then(function () { + $scope.getContent(); + }); + } }; $scope.unpublish = function() { - applySelected( + var attempt = applySelected( function(selected, index) { return contentResource.unPublish(getIdCallback(selected[index])); }, function(count, total) { var key = (total === 1 ? "bulk_unpublishedItemOfItem" : "bulk_unpublishedItemOfItems"); @@ -428,6 +433,11 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie var key = (total === 1 ? "bulk_unpublishedItem" : "bulk_unpublishedItems"); return localizationService.localize(key, [total]); }); + if (attempt) { + attempt.then(function () { + $scope.getContent(); + }); + } }; $scope.move = function() {