Merge pull request #5366 from nextcloud/backport-5365

[stable11] filter missing groups in share provider
This commit is contained in:
Morris Jobke 2017-06-13 08:05:43 -05:00 committed by GitHub
commit 136601ccae
2 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,7 @@ class Manager extends PublicEmitter implements IGroupManager {
private $cachedGroups = array();
/**
* @var \OC\Group\Group[]
* @var \OC\Group\Group[][]
*/
private $cachedUserGroups = array();

View File

@ -736,6 +736,8 @@ class DefaultShareProvider implements IShareProvider {
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
}
$groups = array_filter($groups, function($group) { return $group instanceof IGroup; });
$groups = array_map(function(IGroup $group) { return $group->getGID(); }, $groups);
$qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP)))