Can't copy text from shared office files after Update to 6.2.1
Describe the bug After updating from 6.2.0 to 6.2.1 a user cannot copy text from a shared office document (odt, ods, ...) any more.
To Reproduce Steps to reproduce the behavior:
- Install or Update Nextcloud Office >=6.2.1
- Share a directory with another user
- Create a office document, e.g. a ods file inside the shared directory and input some text
- switch accounts to the second user
- open the document from the shared directory
- copy the previously entered text
Expected behavior The clipboard should contain the text from the document
Actual behavior The clipboard contains:
Stub HTML Message
Copying from the document disabled
Client details:
- OS: Linux
- Browser newest Firefox or Chromium
- Device: Desktop
Server details
Operating system: Debian 10
Web server: NGINX 1.21.6
Database: MariaDB 10.3
PHP version: 8.1
Nextcloud version: 24.0.6
Version of the richdocuments app 6.2.1
Version of Collabora Online 22.05-15
Related Issues
There is another issue over in the server repository: https://github.com/nextcloud/server/issues/34282 This seems to be the same problem, but probably got opened in the wrong repository
I stumbled upon the same issue today (Nextcloud 24.0.6 - Windows 10 - Google Chrome latest version). Only the user who created the shared directory can copy and paste the data contained in its files.
Haven't reproduced or tested yet but from a quick look at the code it seems like this patch could fix this:
diff --git a/lib/TokenManager.php b/lib/TokenManager.php
index 8693daf1..9cb0bda1 100644
--- a/lib/TokenManager.php
+++ b/lib/TokenManager.php
@@ -166,7 +166,7 @@ class TokenManager {
/** @var SharedStorage $storage */
$share = $storage->getShare();
$attributes = $share->getAttributes();
- if ($attributes !== null && !$attributes->getAttribute('permissions', 'download')) {
+ if ($attributes !== null && $attributes->getAttribute('permissions', 'download') === false) {
$hideDownload = true;
break;
}
The proposed change fixes it on my side :+1:
The proposed solution fixed it for me too
Thanks for testing everyone, pull request is at https://github.com/nextcloud/richdocuments/pull/2511