]> source.dussan.org Git - nextcloud-server.git/commitdiff
always get the right node for the given file path
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 20 Nov 2013 15:14:08 +0000 (16:14 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 20 Nov 2013 15:14:08 +0000 (16:14 +0100)
lib/private/connector/sabre/filesplugin.php

index 89444cb8d18a8b83f39646e94b749b86ee53c3cf..1c80ebe80449106cf5052625a59285ce77736676 100644 (file)
@@ -78,6 +78,8 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin
         * @throws Sabre_DAV_Exception_BadRequest
         */
        public function sendFileIdHeader($filePath, Sabre_DAV_INode $node = null) {
+               // we get the node for the given $filePath here because in case of afterCreateFile $node is the parent folder
+               $node = $this->server->tree->getNodeForPath($filePath);
                if ($node instanceof OC_Connector_Sabre_Node) {
                        $fileId = $node->getFileId();
                        if (!is_null($fileId)) {