From 006bbbdf3409a750bc3b9655642764a78cc8fb4b Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 20 Sep 2012 10:21:42 +0800 Subject: [PATCH] MDL-35542 Fixed a bug when trying to directly link to a file from Dropbox --- repository/dropbox/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repository/dropbox/lib.php b/repository/dropbox/lib.php index 768580e6899..508c05ee6fa 100644 --- a/repository/dropbox/lib.php +++ b/repository/dropbox/lib.php @@ -506,6 +506,10 @@ class repository_dropbox extends repository { */ public function get_link($reference) { $ref = unserialize($reference); + if (!isset($ref->url)) { + $this->dropbox->set_access_token($ref->access_key, $ref->access_secret); + $ref->url = $this->dropbox->get_file_share_link($ref->path, self::GETFILE_TIMEOUT); + } return $this->get_file_download_link($ref->url); }