From: Pawel Boguslawski Date: Fri, 4 Nov 2022 12:34:21 +0000 (+0100) Subject: Merge master X-Git-Tag: v27.0.0beta1~338^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a46c747e9ec5e06b26d4ca4c319fcc40d06d504;p=nextcloud-server.git Merge master --- 4a46c747e9ec5e06b26d4ca4c319fcc40d06d504 diff --cc lib/private/Files/Node/Folder.php index b0df1c91293,fb3c78bb801..f09faf78288 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@@ -162,9 -162,10 +163,10 @@@ class Folder extends Node implements \O $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath); $this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]); if (!$this->view->mkdir($fullPath)) { - throw new NotPermittedException('Could not create folder'); + throw new NotPermittedException('Could not create folder "' . $fullPath . '"'); } - $node = new Folder($this->root, $this->view, $fullPath); + $parent = dirname($fullPath) === $this->getPath() ? $this : null; + $node = new Folder($this->root, $this->view, $fullPath, null, $parent); $this->sendHooks(['postWrite', 'postCreate'], [$node]); return $node; } else { @@@ -192,9 -193,9 +194,9 @@@ $result = $this->view->touch($fullPath); } if ($result === false) { - throw new NotPermittedException('Could not create path'); + throw new NotPermittedException('Could not create path "' . $fullPath . '"'); } - $node = new File($this->root, $this->view, $fullPath); + $node = new File($this->root, $this->view, $fullPath, null, $this); $this->sendHooks(['postWrite', 'postCreate'], [$node]); return $node; } @@@ -389,9 -390,8 +391,8 @@@ $this->view->rmdir($this->path); $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo); $this->sendHooks(['postDelete'], [$nonExisting]); - $this->exists = false; } else { - throw new NotPermittedException('No delete permission for path'); + throw new NotPermittedException('No delete permission for path "' . $this->path . '"'); } }