From a86615e9e2cbc762fbd4fa908610bd27b50ac7aa Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 17 Jul 2026 00:07:13 +0200 Subject: [PATCH] fix(files): properly handle folders without permissions There was a bug in the filepicker (dialogs library) that passed always the current folder as selected node even if not pickable (`setCanPick`). So updated the library. But we also must check if we have any nodes selected to enable the copy and move buttons. Signed-off-by: Ferdinand Thiessen --- apps/files/src/actions/moveOrCopyAction.ts | 2 ++ build/frontend-legacy/package.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files/src/actions/moveOrCopyAction.ts b/apps/files/src/actions/moveOrCopyAction.ts index 6b7d34dad96e5..e2b1dd9a679dc 100644 --- a/apps/files/src/actions/moveOrCopyAction.ts +++ b/apps/files/src/actions/moveOrCopyAction.ts @@ -299,6 +299,7 @@ async function openFilePickerForAction( if (action === MoveCopyAction.COPY || action === MoveCopyAction.MOVE_OR_COPY) { buttons.push({ label: target ? t('files', 'Copy to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Copy'), + disabled: selection.length === 0, variant: 'primary', icon: CopyIconSvg, async callback(destination) { @@ -329,6 +330,7 @@ async function openFilePickerForAction( if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) { buttons.push({ label: target ? t('files', 'Move to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Move'), + disabled: selection.length === 0, variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary', icon: FolderMoveSvg, async callback(destination) { diff --git a/build/frontend-legacy/package.json b/build/frontend-legacy/package.json index 0cb25b109b205..8e4cd0225ccf9 100644 --- a/build/frontend-legacy/package.json +++ b/build/frontend-legacy/package.json @@ -33,7 +33,7 @@ "@nextcloud/axios": "^2.5.2", "@nextcloud/browser-storage": "^0.5.0", "@nextcloud/capabilities": "^1.2.1", - "@nextcloud/dialogs": "^7.4.0", + "@nextcloud/dialogs": "^7.4.1", "@nextcloud/event-bus": "^3.3.3", "@nextcloud/files": "^4.0.0", "@nextcloud/initial-state": "^3.0.0", diff --git a/package.json b/package.json index cf50ec961c878..a1d0f3556807a 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@nextcloud/axios": "^2.6.0", "@nextcloud/calendar-availability-vue": "^3.0.0", "@nextcloud/capabilities": "^1.2.1", - "@nextcloud/dialogs": "^7.4.0", + "@nextcloud/dialogs": "^7.4.1", "@nextcloud/event-bus": "^3.3.3", "@nextcloud/files": "^4.0.0", "@nextcloud/initial-state": "^3.0.0",