Skip to content

Commit

Permalink
Merge pull request #3942 from nextcloud/bugfix/noid/fix-share-provider
Browse files Browse the repository at this point in the history
Fix share provider for master changes
  • Loading branch information
juliusknorr authored Jul 29, 2022
2 parents 3b1bae3 + ff39027 commit f5fd8c9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Sharing/DeckShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public function move(IShare $share, $recipient) {
* @inheritDoc
* @returns
*/
public function getSharesInFolder($userId, Folder $node, $reshares) {
public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true) {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('*')
->from('share', 's')
Expand All @@ -516,7 +516,11 @@ public function getSharesInFolder($userId, Folder $node, $reshares) {
}

$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
if ($shallow) {
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
} else {
$qb->andWhere($qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($node->getInternalPath()) . '/%')));
}

$qb->orderBy('s.id');

Expand Down

0 comments on commit f5fd8c9

Please sign in to comment.