From a95ccf4248251e6593350aa640395f28d24bbe62 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 7 Mar 2018 13:33:35 +0100 Subject: [PATCH 1/2] disable part files for object stores Signed-off-by: Robin Appelman --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index acb8d67078023..4c54007147160 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -424,4 +424,8 @@ public function writeBack($tmpFile, $path) { public function hasUpdated($path, $time) { return false; } + + public function needsPartFile() { + return false; + } } From 9342f97a28f20471643728b3c735772c0dd108f1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 8 Mar 2018 13:02:35 +0100 Subject: [PATCH 2/2] emit pre-hooks earlier when not using part files Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/File.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 597e6ebef90c9..6a467e9eff28f 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -144,6 +144,8 @@ public function put($data) { } else { // upload file directly as the final path $partFilePath = $this->path; + + $this->emitPreHooks($exists); } // the part file and target file might be on a different storage in case of a single file storage (e.g. single file share) @@ -188,11 +190,7 @@ public function put($data) { try { $view = \OC\Files\Filesystem::getView(); - if ($view) { - $run = $this->emitPreHooks($exists); - } else { - $run = true; - } + $run = ($view && $needsPartFile) ? $this->emitPreHooks($exists) : true; try { $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE);