Manage limit and offset in usersInGroup function
Since user_sql apps don't manage limit and offset in **usersInGroup** function:
`$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true);`
The unshareFromGroup function of **Activity** app start a infinity loop :
```
while (!empty($users)) {
$this->addNotificationsForGroupUsers($users, 'unshared_by', $share->getNodeId(), $share->getNodeType(), $share->getTarget(), $share->getId());
$offset += self::USER_BATCH_SIZE;
$users = $group->searchUsers('', self::USER_BATCH_SIZE, $offset);
}
```
to fix that, just add offset and limit params to runQuery :
```
$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true, ['limit' => $limit, 'offset' => $offset]);
```
This commit is contained in:
@@ -64,7 +64,7 @@ class OC_GROUP_SQL extends \OC_Group_Backend implements \OCP\GroupInterface
|
||||
Util::writeLog('OC_USER_SQL', "Group table not configured", Util::DEBUG);
|
||||
return [];
|
||||
}
|
||||
$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true);
|
||||
$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true, ['limit' => $limit, 'offset' => $offset]);
|
||||
if($rows === false)
|
||||
{
|
||||
Util::writeLog('OC_USER_SQL', "Found no users for group", Util::DEBUG);
|
||||
Reference in New Issue
Block a user