emit pre-hooks earlier when not using part files

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-03-08 13:02:35 +01:00
parent 50162e619c
commit 550f9cafc8
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 3 additions and 5 deletions

View File

@ -117,6 +117,8 @@ class File extends Node implements IFile {
} else { } else {
// upload file directly as the final path // upload file directly as the final path
$partFilePath = $this->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) // the part file and target file might be on a different storage in case of a single file storage (e.g. single file share)
@ -161,11 +163,7 @@ class File extends Node implements IFile {
try { try {
$view = \OC\Files\Filesystem::getView(); $view = \OC\Files\Filesystem::getView();
if ($view) { $run = ($view && $needsPartFile) ? $this->emitPreHooks($exists) : true;
$run = $this->emitPreHooks($exists);
} else {
$run = true;
}
try { try {
$this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE);