diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-04-11 10:44:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 10:44:47 +0200 |
commit | 0b8582f315bb45133c76fd0d9ee2e31528184980 (patch) | |
tree | c3b8b569efc36cae98291259091b2088f1ff7aab /lib | |
parent | cde260577e90dc7f3aea1d610ae6c2b93e949af5 (diff) | |
parent | e83ad8cfad0c6bcbe8f633c362e2e136d765c499 (diff) | |
download | nextcloud-server-0b8582f315bb45133c76fd0d9ee2e31528184980.tar.gz nextcloud-server-0b8582f315bb45133c76fd0d9ee2e31528184980.zip |
Merge pull request #31610 from nextcloud/shares-in-folder-mounts
fix shared mount roots not being returned from `getSharesInFolder`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 6e8d9105a76..9638706025b 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -670,8 +670,21 @@ class DefaultShareProvider implements IShareProvider { ); } + // todo? maybe get these from the oc_mounts table + $childMountNodes = array_filter($node->getDirectoryListing(), function (Node $node) { + return $node->getInternalPath() === ''; + }); + $childMountRootIds = array_map(function (Node $node) { + return $node->getId(); + }, $childMountNodes); + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); - $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); + $qb->andWhere( + $qb->expr()->orX( + $qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())), + $qb->expr()->in('f.fileid', $qb->createNamedParameter($childMountRootIds, IQueryBuilder::PARAM_INT_ARRAY)) + ) + ); $qb->orderBy('id'); |