diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-08-12 15:22:33 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-14 20:35:33 +0200 |
commit | 75f126da49acefb54f64f4ce04cc1915bb3fbbcc (patch) | |
tree | 9f409b1e0d370186cc5758232f7bd4692e15a25d | |
parent | 80f054ddd347a7b828594d8a4c52fb79b7a89506 (diff) | |
download | nextcloud-server-75f126da49acefb54f64f4ce04cc1915bb3fbbcc.tar.gz nextcloud-server-75f126da49acefb54f64f4ce04cc1915bb3fbbcc.zip |
use the correct path for cache updates when doing chunked assembly
-rw-r--r-- | lib/private/connector/sabre/file.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index a7e529183b6..c9f81b98aa5 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -205,8 +205,11 @@ class File extends Node implements IFile { return '"' . $this->info->getEtag() . '"'; } - private function emitPreHooks($exists) { - $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($this->path)); + private function emitPreHooks($exists, $path = null) { + if (is_null($path)) { + $path = $this->path; + } + $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); $run = true; if (!$exists) { @@ -226,8 +229,11 @@ class File extends Node implements IFile { )); } - private function emitPostHooks($exists) { - $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($this->path)); + private function emitPostHooks($exists, $path = null) { + if (is_null($path)) { + $path = $this->path; + } + $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); if (!$exists) { \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array( \OC\Files\Filesystem::signal_param_path => $hookPath @@ -362,7 +368,7 @@ class File extends Node implements IFile { $exists = $this->fileView->file_exists($targetPath); try { - $this->emitPreHooks($exists); + $this->emitPreHooks($exists, $targetPath); $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); @@ -408,9 +414,9 @@ class File extends Node implements IFile { $this->changeLock(ILockingProvider::LOCK_SHARED); // since we skipped the view we need to scan and emit the hooks ourselves - $this->fileView->getUpdater()->update($this->path); + $this->fileView->getUpdater()->update($targetPath); - $this->emitPostHooks($exists); + $this->emitPostHooks($exists, $targetPath); $info = $this->fileView->getFileInfo($targetPath); return $info->getEtag(); |