aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLouis <louis@chmn.me>2024-12-04 17:02:56 +0100
committerGitHub <noreply@github.com>2024-12-04 17:02:56 +0100
commit1ef3e3e753aa1e1e767f6e1ed6576a0c00b27030 (patch)
tree2dad217ec9bacefec0813f81818f4da8d415588d /lib
parent27331d48e377d5e908439cfdef8950b4b5ec47b2 (diff)
parent8be6a7c7dd51b018a20fb4f1c7e530999bc10faf (diff)
downloadnextcloud-server-1ef3e3e753aa1e1e767f6e1ed6576a0c00b27030.tar.gz
nextcloud-server-1ef3e3e753aa1e1e767f6e1ed6576a0c00b27030.zip
Merge pull request #49293 from nextcloud/artonge/fix/handle_folders_copy_live_photos
fix: Handle copy of folders containing live photos
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Node/HookConnector.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Node/HookConnector.php b/lib/private/Files/Node/HookConnector.php
index 423eea258ed..1149951174c 100644
--- a/lib/private/Files/Node/HookConnector.php
+++ b/lib/private/Files/Node/HookConnector.php
@@ -171,7 +171,7 @@ class HookConnector {
public function copy($arguments) {
$source = $this->getNodeForPath($arguments['oldpath']);
- $target = $this->getNodeForPath($arguments['newpath']);
+ $target = $this->getNodeForPath($arguments['newpath'], $source instanceof Folder);
$this->root->emit('\OC\Files', 'preCopy', [$source, $target]);
$this->dispatcher->dispatch('\OCP\Files::preCopy', new GenericEvent([$source, $target]));
@@ -203,7 +203,7 @@ class HookConnector {
$this->dispatcher->dispatchTyped($event);
}
- private function getNodeForPath(string $path): Node {
+ private function getNodeForPath(string $path, bool $isDir = false): Node {
$info = Filesystem::getView()->getFileInfo($path);
if (!$info) {
$fullPath = Filesystem::getView()->getAbsolutePath($path);
@@ -212,7 +212,7 @@ class HookConnector {
} else {
$info = null;
}
- if (Filesystem::is_dir($path)) {
+ if ($isDir || Filesystem::is_dir($path)) {
return new NonExistingFolder($this->root, $this->view, $fullPath, $info);
} else {
return new NonExistingFile($this->root, $this->view, $fullPath, $info);