Commit 7649d23
authored
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]);
```1 parent ebcdaa8 commit 7649d23
1 file changed
Lines changed: 1 addition & 1 deletion
lib/group_sql.php renamed to lib/$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' =>
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
0 commit comments