Dont do a cache rename if we cant delete the source file
This commit is contained in:
parent
215388f4e0
commit
ce0aa02aac
|
@ -80,7 +80,9 @@ class Storage extends Wrapper {
|
||||||
$result = \OCA\Files_Trashbin\Trashbin::move2trash($filesPath);
|
$result = \OCA\Files_Trashbin\Trashbin::move2trash($filesPath);
|
||||||
// in cross-storage cases the file will be copied
|
// in cross-storage cases the file will be copied
|
||||||
// but not deleted, so we delete it here
|
// but not deleted, so we delete it here
|
||||||
$this->storage->unlink($path);
|
if ($result) {
|
||||||
|
$this->storage->unlink($path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = $this->storage->unlink($path);
|
$result = $this->storage->unlink($path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -527,7 +527,7 @@ class View {
|
||||||
fclose($target);
|
fclose($target);
|
||||||
|
|
||||||
if ($result !== false) {
|
if ($result !== false) {
|
||||||
$storage1->unlink($internalPath1);
|
$result &= $storage1->unlink($internalPath1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -537,7 +537,7 @@ class View {
|
||||||
if ($this->shouldEmitHooks()) {
|
if ($this->shouldEmitHooks()) {
|
||||||
$this->emit_file_hooks_post($exists, $path2);
|
$this->emit_file_hooks_post($exists, $path2);
|
||||||
}
|
}
|
||||||
} elseif ($result !== false) {
|
} elseif ($result) {
|
||||||
$this->updater->rename($path1, $path2);
|
$this->updater->rename($path1, $path2);
|
||||||
if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) {
|
if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) {
|
||||||
\OC_Hook::emit(
|
\OC_Hook::emit(
|
||||||
|
|
Loading…
Reference in New Issue