diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-04-14 13:50:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 13:50:35 +0200 |
commit | 8e49840b4a32d733a5fbe6e6004a310201f7d405 (patch) | |
tree | 7ef22852ebc5192e53e96f86ebc4307bf371c58c | |
parent | b3456416060167a639d45a41da4a6f10c5369e17 (diff) | |
parent | ef5b60e4cb77433e08877fa83fb4692e138e071f (diff) | |
download | nextcloud-server-8e49840b4a32d733a5fbe6e6004a310201f7d405.tar.gz nextcloud-server-8e49840b4a32d733a5fbe6e6004a310201f7d405.zip |
Merge pull request #31923 from nextcloud/backport/31610/stable23
[stable23] fix shared mount roots not being returned from `getSharesInFolder`
-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 cfc4079e117..110b81be930 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -666,8 +666,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'); |