MDL-58535 repository_onedrive: Use the weblink

The permission has it's own weblink which is different from the link on the original doc.
This commit is contained in:
Damyon Wiese 2017-05-01 13:59:15 +08:00
parent c0a4efdce2
commit 13d21db324

View File

@ -706,7 +706,7 @@ class repository_onedrive extends repository {
$details = 'Cannot update link sharing for the document: ' . $fileid;
throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
}
return true;
return $response->link->webUrl;
}
/**
@ -879,13 +879,13 @@ class repository_onedrive extends repository {
$fileid = $this->upload_file($systemservice, $curl, $temppath, $mimetype, $parentid, $safefilename);
// Read with link.
$this->set_file_sharing_anyone_with_link_can_read($systemservice, $fileid);
$link = $this->set_file_sharing_anyone_with_link_can_read($systemservice, $fileid);
$summary = $this->get_file_summary($systemservice, $fileid);
// Update the details in the file reference before it is saved.
$source->id = $summary->id;
$source->link = $summary->webUrl;
$source->link = $link;
$reference = json_encode($source);