Skip to content

Commit 7649d23

Browse files
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

File tree

lib/group_sql.php renamed to lib/$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' =>

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function usersInGroup($gid, $search = '', $limit = null, $offset = null)
6464
Util::writeLog('OC_USER_SQL', "Group table not configured", Util::DEBUG);
6565
return [];
6666
}
67-
$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true);
67+
$rows = $this -> helper -> runQuery('getGroupUsers', array('gid' => $gid), false, true, ['limit' => $limit, 'offset' => $offset]);
6868
if($rows === false)
6969
{
7070
Util::writeLog('OC_USER_SQL', "Found no users for group", Util::DEBUG);

0 commit comments

Comments
 (0)