Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The FilePicker does not load for moving or copying a file or a folder when not logged in #45420

Closed
5 of 8 tasks
ainar opened this issue May 21, 2024 · 0 comments · Fixed by nextcloud-libraries/nextcloud-files#959 or #45538
Assignees

Comments

@ainar
Copy link

ainar commented May 21, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

The file picker does not load for moving or copying a file or a folder when not logged in.

image

Steps to reproduce

  1. While being logged in, share link of any folder
    1. Click on image at the right of the folder name,
    2. "Open details", "Sharing" tab, "+" at the right of "Share link"
  2. Set the sharling link as "can edit" (Screenshot below)
    1. after the preceding steps, click on "View only", then click on "Can edit" in the drop-down list.
  3. Go into the folder and create a new file (any type) or folder.
  4. Log-out of Nextcloud or open a Private window of your web browser.
  5. Paste the sharing link of your newly shared folder.
  6. Click on image at the right of the previously created file.
  7. Click on "Move or copy".

image

Expected behavior

The file picker should load and display the current directory.

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

The browser console output

Error: No user id found
    M index.mjs:871
    l FilePicker-DBGB1Rec.mjs:797
    f FilePicker-DBGB1Rec.mjs:825
    async* FilePicker-DBGB1Rec.mjs:829
    VueJS 25
    render index.mjs:33
    VueJS 8
    s index.mjs:30
    pick index.mjs:88
    pick index.mjs:87
    filepicker dialogs.js:360
    actionHandler fileactions.js:701
    action fileactions.js:136
    _onClickAction fileactionsmenu.js:63
    jQuery 10
    Backbone 6
    _showMenu fileactions.js:375
    Underscore 3
    _renderInlineAction fileactions.js:467
    jQuery 5
vue.runtime.esm.js:3065:16
    VueJS 29
    render index.mjs:33
    VueJS 8
    s index.mjs:30
    pick index.mjs:88
    pick index.mjs:87
    filepicker dialogs.js:360
    actionHandler fileactions.js:701
    action fileactions.js:136
    _onClickAction fileactionsmenu.js:63
    jQuery 10
    Backbone 6
    _showMenu fileactions.js:375
    Underscore 3
    _renderInlineAction fileactions.js:467
    jQuery 5

This is the error thrown:

throw new Error('No user id found')

I think it is where it is called from:

const otherNodes = await getContents(destination.path)

The call of getContents seems to be the culprit there. And it is not systematic in this file.

  • When method === MoveCopyAction.COPY, it's using client.getDirectoryContents.
  • Otherwise (e.g., MoveCopyAction.MOVE_OR_COPY) , getContents (which looks for the user id) is used.

Moreover, it seems the comments are not consistent with the code.
Example:

https://github.com/nextcloud/server/blob/5a6e48e85034aa81862b1fcbd93cb4ce58165e72/apps/files/src/actions/moveOrCopyAction.ts#L144C1-L146C52

// show conflict file popup if we do not allow overwriting
const otherNodes = await getContents(destination.path)
if (hasConflict([node], otherNodes.contents)) {

It seems nothing is testing of we allow or not overwriting since 9d613d0.

@emoral435, do you have an insight on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants