diff --git a/src/opnsense/mvc/app/library/Google/API/Drive.php b/src/opnsense/mvc/app/library/Google/API/Drive.php index 0e29e22d8..0585f47c6 100644 --- a/src/opnsense/mvc/app/library/Google/API/Drive.php +++ b/src/opnsense/mvc/app/library/Google/API/Drive.php @@ -1,7 +1,7 @@ service->files->listFiles(array('q' => $query)); + return $this->service->files->listFiles(['q' => $query, 'supportsAllDrives' => true]); } @@ -108,7 +108,7 @@ class Drive */ public function download($fileHandle) { - $response = $this->service->files->get($fileHandle->id, array('alt' => 'media')); + $response = $this->service->files->get($fileHandle->id, ['alt' => 'media', 'supportsAllDrives' => true]); return $response->getBody()->getContents(); } @@ -127,13 +127,14 @@ class Drive $file->setName($filename); $file->setDescription($filename); $file->setMimeType('text/plain'); - $file->setParents(array($directoryId)); + $file->setParents([$directoryId]); - $createdFile = $this->service->files->create($file, array( + $createdFile = $this->service->files->create($file, [ 'data' => $content, 'mimeType' => $mimetype, 'uploadType' => 'media', - )); + 'supportsAllDrives' => true + ]); return $createdFile; } @@ -144,6 +145,6 @@ class Drive */ public function delete($fileHandle) { - $this->service->files->delete($fileHandle['id']); + $this->service->files->delete($fileHandle['id'], ['supportsAllDrives' => true]); } }