Skip to content

Commit

Permalink
wip: try to fix webdav propfinds with depth > 1
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Feb 14, 2023
1 parent 5ee5847 commit 248c224
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getDirectoryListing() {

return array_map(function (FileInfo $info) {
if ($info->getMimetype() === FileInfo::MIMETYPE_FOLDER) {
return new Folder($this->root, $this->view, $info->getPath(), $info, $this);
return new Folder($this->root, $this->view, $this->view->getRelativePath($info->getPath()), $info, $this);
} else {
return new File($this->root, $this->view, $info->getPath(), $info, $this);
}
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/Files/Node/FolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public function testGetDirectoryContent() {
new FileInfo('/bar/foo/asd', null, 'foo/asd', ['fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'], null),
new FileInfo('/bar/foo/qwerty', null, 'foo/qwerty', ['fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory'], null),
]);
$view->method('getRelativePath')
->willReturnCallback(function ($path) {
return $path;
});
$view->method('getFileInfo')
->willReturn($this->createMock(FileInfo::class));

Expand Down

0 comments on commit 248c224

Please sign in to comment.