diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-10-02 13:25:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 13:25:49 +0200 |
commit | 9bf55c33e15e6c2a576604e35e86b344fa6f534f (patch) | |
tree | a451de7450b1b3ccab11e0de163247fc531b4d41 | |
parent | 2f214322f794d72e518d989b7d82e3bf44b3e651 (diff) | |
parent | 6db51324fa5ecbd12728b1e86e0d4a7b860a92d4 (diff) | |
download | nextcloud-server-9bf55c33e15e6c2a576604e35e86b344fa6f534f.tar.gz nextcloud-server-9bf55c33e15e6c2a576604e35e86b344fa6f534f.zip |
Merge pull request #17366 from nextcloud/fix/usersIngroup
Fix DB usersInGroups fetching
-rw-r--r-- | lib/private/Group/Database.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 7a5728b957d..4df70f143ba 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -322,7 +322,7 @@ class Database extends ABackend * @param int $offset * @return array an array of user ids */ - public function usersInGroup($gid, $search = '', $limit = null, $offset = null) { + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { $this->fixDI(); $query = $this->dbConn->getQueryBuilder(); @@ -337,8 +337,13 @@ class Database extends ABackend ))); } - $query->setMaxResults($limit) - ->setFirstResult($offset); + if ($limit !== -1) { + $query->setMaxResults($limit); + } + if ($offset !== 0) { + $query->setFirstResult($offset); + } + $result = $query->execute(); $users = []; |