Page MenuHomePhorge

D5733.1775204790.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D5733.1775204790.diff

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
@@ -194,12 +194,16 @@
if ($item === null) {
$query = Auth::$user->fsItems()->select('fs_items.*', 'fs_properties.value as name')
->join('fs_properties', 'fs_items.id', '=', 'fs_properties.item_id')
+ ->whereNot('type', '&', Item::TYPE_INCOMPLETE)
->where('key', 'name')
->where('value', $item_name); // TODO: Make sure it's a case-sensitive match?
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

Mime Type
text/plain
Expires
Fri, Apr 3, 8:26 AM (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823224
Default Alt Text
D5733.1775204790.diff (2 KB)

Event Timeline