]> source.dussan.org Git - nextcloud-server.git/commitdiff
Accept moving FutureFile into a Directory
authorVincent Petry <pvince81@owncloud.com>
Wed, 29 Mar 2017 15:01:04 +0000 (17:01 +0200)
committerJoas Schilling <coding@schilljs.com>
Wed, 26 Apr 2017 13:43:01 +0000 (15:43 +0200)
apps/dav/lib/Connector/Sabre/Directory.php

index a26420344d040d46341db0ee9f9097a9b4ee0242..ddf324ce8518416a65e56f8fca48ed2f5677e58f 100644 (file)
@@ -43,6 +43,7 @@ use Sabre\DAV\Exception\ServiceUnavailable;
 use Sabre\DAV\INode;
 use Sabre\DAV\Exception\BadRequest;
 use OC\Files\Mount\MoveableMount;
+use Sabre\DAV\IFile;
 
 class Directory extends \OCA\DAV\Connector\Sabre\Node
        implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota, \Sabre\DAV\IMoveTarget {
@@ -344,6 +345,11 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
         */
        public function moveInto($targetName, $fullSourcePath, INode $sourceNode) {
                if (!$sourceNode instanceof Node) {
+                       // it's a file of another kind, like FutureFile
+                       if ($sourceNode instanceof IFile) {
+                               // fallback to default copy+delete handling
+                               return false;
+                       }
                        throw new BadRequest('Incompatible node types');
                }