Repository navigation
fix(filesDrop): drag-and-drop folder upload - #59294
Conversation
afb9a61 to
8373f2c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
susnux
left a comment
There was a problem hiding this comment.
I see this is not about not uploading in the "root" but its about different dav roots
|
/backport to stable33 |
|
/backport to stable32 |
|
/backport to stable31 |
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
8373f2c to
5a9fa36
Compare
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
| export async function createDirectoryIfNotExists(path: string) { | ||
| const davUrl = join(defaultRemoteURL, defaultRootPath) | ||
| export async function createDirectoryIfNotExists(path: string, destination?: IFolder) { | ||
| const davUrl = destination?.source ?? join(defaultRemoteURL, defaultRootPath) |
There was a problem hiding this comment.
Apologies for bumping the merged PR, however, note that this line seems to have introduced a regression where the destination.source variable isn't URL-encoded before being used in the DAV client.
Reproduce instructions:
- Create a folder which name started with the
#symbol - Enter the created folder
- Drag and drop to upload a folder into this folder.
Expected behavior:
Folder uploaded successfully.
Current behavior:
- No folder creation MKCOL request sent
- Folder content upload PUT requests failed with 404 error since the folder isn't created in the first place
Maybe related to nextcloud-libraries/nextcloud-upload#1964, but the issue creation date is earlier than this fix so I'm not sure.
There was a problem hiding this comment.
This problem seems to be already filed as #62716.
|
This pull request has been automatically locked because it has been closed for more than 7 days. As we do not monitor merged or closed pull requests, we are locking this pull request to prevent further comments from getting lost in the noise. |
Summary
When dragging and dropping a folder structure into any non-root destination (group folders, subfolders), subdirectories were created at the wrong WebDAV path. For team folders, the directory was created in the user's personal files entirely. Files then failed to upload because the target directory didn't exist in the team folder.
The fix: pass the destination (
IFolder) tocreateDirectoryIfNotExistsso it usesdestination.sourceas its WebDAV base URL, asuploader.uploadalready does.Please note: the bug affects any non-root destination equally.
The old code only worked "by accident" when the user was at the root level, because
destination.sourcehappened to equaldefaultRemoteURL + defaultRootPath. The moment you navigate into any subfolder, regular or Team Folder, and drag-drop a folder there, the MKCOL goes to the wrong location (it creates the directory at the user root instead of the current folder).The fix should apply universally to any non-root destination.
Checklist
3. to review, feature component)stable32)AI (if applicable)