Merge pull request #7654 from kjac/v8/fix/recycle-bin-without-mculture

V8: Ensure that the recycle bin doesn't delete content at root
(cherry picked from commit 4275401c4b)
This commit is contained in:
Warren Buckley
2020-02-24 15:50:13 +00:00
parent b41c3ad3bc
commit baacd6f27f
2 changed files with 8 additions and 3 deletions

View File

@@ -220,7 +220,7 @@ function startupLatestEditsController($scope) {
}
angular.module("umbraco").controller("Umbraco.Dashboard.StartupLatestEditsController", startupLatestEditsController);
function MediaFolderBrowserDashboardController($rootScope, $scope, $location, contentTypeResource, userService) {
function MediaFolderBrowserDashboardController($scope, $routeParams, $location, contentTypeResource, userService) {
var currentUser = {};
@@ -251,6 +251,8 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
view: dt.view
};
// tell the list view to list content at root
$routeParams.id = -1;
});
} else if (currentUser.startMediaIds.length > 0){

View File

@@ -276,6 +276,9 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time
}
$scope.reloadView = function (id, reloadActiveNode) {
if (!id) {
return;
}
$scope.viewLoaded = false;
$scope.folders = [];
@@ -713,10 +716,10 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time
}
function initView() {
//default to root id if the id is undefined
var id = $routeParams.id;
if (id === undefined) {
id = -1;
// no ID found in route params - don't list anything as we don't know for sure where we are
return;
}
getContentTypesCallback(id).then(function (listViewAllowedTypes) {