From f3fc83fae6f13b906df466904a32ac4003a4169b Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Thu, 18 Jul 2019 11:04:06 +0100 Subject: [PATCH 1/2] Fixes #5932, showing "Return to ListView" for new content --- .../common/directives/components/content/edit.controller.js | 4 ++++ 1 file changed, 4 insertions(+) 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 5bcab56f48..01e9b12c99 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 @@ -184,6 +184,10 @@ $scope.content = data; + if (data.isChildOfListView && data.trashed === false) { + $scope.page.listViewPath = $routeParams.page ? '/content/content/edit/' + data.parentId + '?page=' + $routeParams.page : '/content/content/edit/' + data.parentId; + } + init($scope.content); resetLastListPageNumber($scope.content); From 249126a2b5202e64c04b212a34fcea91b2260010 Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Thu, 18 Jul 2019 11:01:46 +0100 Subject: [PATCH 2/2] Fixes #5931, show breadcrumb for new content Could probably do with adding "Untitled" to translation file --- .../components/content/edit.controller.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 01e9b12c99..db25399135 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 @@ -27,13 +27,18 @@ editorState.set($scope.content); //We fetch all ancestors of the node to generate the footer breadcrumb navigation - if (!$scope.page.isNew) { - if (content.parentId && content.parentId !== -1) { - entityResource.getAncestors(content.id, "document") - .then(function (anc) { - $scope.ancestors = anc; - }); + if (content.parentId && content.parentId !== -1) { + var ancestorIds = content.path.split(','); + ancestorIds.shift(); // Remove -1 + if ($scope.page.isNew) { + ancestorIds.pop(); // Remove 0 } + entityResource.getByIds(ancestorIds, 'document').then(function (anc) { + $scope.ancestors = anc; + if ($scope.page.isNew) { + $scope.ancestors.push({ name: "Untitled" }) + } + }); } evts.push(eventsService.on("editors.content.changePublishDate", function (event, args) {