Skip to content
Commit f89c3f7f authored by Martijn Schmidt's avatar Martijn Schmidt Committed by Elvis Angelaccio
Browse files

KIOGDrive::copy - resolve the destGDriveUrl's new parent into a destDirId...

KIOGDrive::copy - resolve the destGDriveUrl's new parent into a destDirId before passing it to FileCopyJob in src/kio_gdrive.cpp

Summary:
KIOGDrive::copy doesn't resolve the destGDriveUrl's new parent into a destDirId before passing it to FileCopyJob, which means it'll be sending an illegal request body to the Google Drive API - for example:

```{
   \"editable\":false,
   \"kind\":\"drive#file\",
   \"lastViewedByMeDate\":   \"2018-01-10T19:38:11   Z\",
   \"modifiedDate\":   \"2018-01-10T19:38:11   Z\",
   \"parents\":[
      {
         \"id\":\"testfoldertwo\"
      }
   ],
   \"title\":\"yetanothertestfile.txt\"
}```

The "id" field should contain a valid parent ID rather than an originalFilename, and this patch resolves the right parent ID in one of two ways:

- If the target folder of the copy command is the root of the GDrive, resolve the rootFolderId from the destAccountId.
- If the target folder of the copy command is any other directory on the GDrive, resolve the fileId of the destGDriveUrl's pa...
parent efc22ef8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment