Skip to content

Commit e83ad8c

Browse files
committed
fix shared mount roots not being returned from getSharesInFolder
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent bf48c0b commit e83ad8c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/private/Share20/DefaultShareProvider.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,21 @@ public function getSharesInFolder($userId, Folder $node, $reshares) {
670670
);
671671
}
672672

673+
// todo? maybe get these from the oc_mounts table
674+
$childMountNodes = array_filter($node->getDirectoryListing(), function (Node $node) {
675+
return $node->getInternalPath() === '';
676+
});
677+
$childMountRootIds = array_map(function (Node $node) {
678+
return $node->getId();
679+
}, $childMountNodes);
680+
673681
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
674-
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
682+
$qb->andWhere(
683+
$qb->expr()->orX(
684+
$qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())),
685+
$qb->expr()->in('f.fileid', $qb->createNamedParameter($childMountRootIds, IQueryBuilder::PARAM_INT_ARRAY))
686+
)
687+
);
675688

676689
$qb->orderBy('id');
677690

0 commit comments

Comments
 (0)