Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117763204
D5733.1775218829.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5733.1775218829.diff
View Options
diff --git a/src/app/Http/DAV/Node.php b/src/app/Http/DAV/Node.php
--- a/src/app/Http/DAV/Node.php
+++ b/src/app/Http/DAV/Node.php
@@ -200,6 +200,9 @@
if ($parent) {
$query->join('fs_relations', 'fs_items.id', '=', 'fs_relations.related_id')
->where('fs_relations.item_id', $parent->id);
+ } else {
+ $query->leftJoin('fs_relations', 'fs_items.id', '=', 'fs_relations.related_id')
+ ->whereNull('fs_relations.related_id');
}
$item = $query->first();
diff --git a/src/tests/Feature/Controller/DAVTest.php b/src/tests/Feature/Controller/DAVTest.php
--- a/src/tests/Feature/Controller/DAVTest.php
+++ b/src/tests/Feature/Controller/DAVTest.php
@@ -532,12 +532,12 @@
$this->assertCount(0, $folders[1]->parents()->get());
$this->assertSame('folder20', $folders[1]->getProperty('name'));
- // Test moving a file into the root
- $response = $this->davRequest('MOVE', "{$root}/folder10/test3.txt", '', $john, ['Destination' => "{$host}/{$root}/test30.txt"]);
+ // Test moving a file into the root (with no rename)
+ $response = $this->davRequest('MOVE', "{$root}/folder10/test3.txt", '', $john, ['Destination' => "{$host}/{$root}/test3.txt", 'Overwrite' => 'F']);
$response->assertNoContent(201);
$this->assertCount(0, $files[2]->parents()->get());
- $this->assertSame('test30.txt', $files[2]->getProperty('name'));
+ $this->assertSame('test3.txt', $files[2]->getProperty('name'));
$this->assertSame('text/plain', $files[2]->getProperty('mimetype'));
// Test moving a folder from root into another folder (no rename)
@@ -556,7 +556,7 @@
$this->assertSame('text/html', $files[1]->getProperty('mimetype'));
// Test moving into an existing location with Overwrite:F header
- $response = $this->davRequest('MOVE', "{$root}/moved1.txt", '', $john, ['Destination' => "{$host}/{$root}/test30.txt", 'Overwrite' => 'F']);
+ $response = $this->davRequest('MOVE', "{$root}/moved1.txt", '', $john, ['Destination' => "{$host}/{$root}/test3.txt", 'Overwrite' => 'F']);
$response->assertStatus(412);
$doc = $this->responseXML($response);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 12:20 PM (17 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18775437
Default Alt Text
D5733.1775218829.diff (2 KB)
Attached To
Mode
D5733: WebDAV: Fix moving files without rename
Attached
Detach File
Event Timeline