diff options
author | Maxence Lange <maxence@nextcloud.com> | 2017-05-02 13:00:48 +0300 |
---|---|---|
committer | Maxence Lange <maxence@nextcloud.com> | 2017-05-02 13:00:48 +0300 |
commit | d7f625ba0ee5b8b9652018480b6ca33d61e0a8f8 (patch) | |
tree | 794cd9a3a6c99450d2ab43a3a1318c639f70bace | |
parent | 26871e06defa76f2494a35594d311f29b4ad2f34 (diff) |
bugfixes
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
-rw-r--r-- | lib/Command/Check.php | 2 | ||||
-rw-r--r-- | lib/Service/FileService.php | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/Command/Check.php b/lib/Command/Check.php index fa7de06..d27a586 100644 --- a/lib/Command/Check.php +++ b/lib/Command/Check.php @@ -106,7 +106,7 @@ class Check extends Base if (! $this->solrAdmin->checkSchema(($input->getOption('fix')), $ierror)) { if ($ierror->getCode() > 0) { - $this->output->writeln('*** Error #' . $ierror->getCode() . ' (' . $ierror->getMessage() . ')'); + $output->writeln('*** Error #' . $ierror->getCode() . ' (' . $ierror->getMessage() . ')'); return; } } diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index 1824f10..25c67ac 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -34,6 +34,7 @@ use OC\Files\Filesystem; use OC\Files\View; use OC\Share\Share; use OCP\Files\NotFoundException; +use OCP\Files\StorageNotAvailableException; class FileService { @@ -235,8 +236,20 @@ class FileService $item->setAbsolutePath($this->view->toTmpFile($item->getPath()), true); return true; } - - // We generate a local tmp file from the remote one + + // not local, not external nor encrypted, we generate temp file + if (! $item->isExternal() && ! $item->isEncrypted()) { + try { + $item->setAbsolutePath($this->view->toTmpFile($item->getPath()), true); + } catch (StorageNotAvailableException $ex) { + $ierror = new ItemError(ItemError::EXCEPTION_INDEXDOCUMENT_WITHOUT_ABSOLUTEPATH, $ex->getHint()); + return false; + } + return true; + } + + + // We generate a local tmp file from the remote one if ($item->isExternal() && $this->configService->getAppValue('index_files_external') === '1') { try { $item->setAbsolutePath($this->view->toTmpFile($item->getPath()), true); |