From bc67f4b1d1be5ad0fb34f98c25c974a08aa23aea Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 21 Mar 2022 22:33:24 +0100 Subject: [PATCH] Fix parent folder rename --- changelog/unreleased/bugfix-rename-parent | 6 ++++++ packages/web-app-files/src/mixins/actions/rename.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-rename-parent diff --git a/changelog/unreleased/bugfix-rename-parent b/changelog/unreleased/bugfix-rename-parent new file mode 100644 index 00000000000..49f8d8074d1 --- /dev/null +++ b/changelog/unreleased/bugfix-rename-parent @@ -0,0 +1,6 @@ +Bugfix: Rename parent folder + +We fixed the rename option in the parent folder / breadcrumb context menu. It was broken due to malformed webdav paths. + +https://github.com/owncloud/web/issues/6516 +https://github.com/owncloud/web/pull/6631 diff --git a/packages/web-app-files/src/mixins/actions/rename.js b/packages/web-app-files/src/mixins/actions/rename.js index 59b20d4b2a3..6f0395dd527 100644 --- a/packages/web-app-files/src/mixins/actions/rename.js +++ b/packages/web-app-files/src/mixins/actions/rename.js @@ -53,7 +53,10 @@ export default { async $_rename_trigger({ resources }) { let parentResources if (isSameResource(resources[0], this.currentFolder)) { - const parentPaths = getParentPaths(resources[0].path, false) + const prefix = resources[0].webDavPath.slice(0, -resources[0].path.length) + const parentPaths = getParentPaths(resources[0].path, false).map((path) => { + return prefix + path + }) parentResources = await this.$client.files.list(parentPaths[0], 1) parentResources = parentResources.map(buildResource) }