Skip to content

Commit f541174

Browse files
committed
Fix default value not consistent with interface
Signed-off-by: Carl Schwan <[email protected]>
1 parent 95f390d commit f541174

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/private/Group/Database.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function getUserGroups($uid) {
263263
*
264264
* Returns a list with all groups
265265
*/
266-
public function getGroups($search = '', $limit = null, $offset = null) {
266+
public function getGroups($search = '', $limit = -1, $offset = 0) {
267267
$this->fixDI();
268268

269269
$query = $this->dbConn->getQueryBuilder();
@@ -280,9 +280,11 @@ public function getGroups($search = '', $limit = null, $offset = null) {
280280
)));
281281
}
282282

283-
$query->setMaxResults($limit)
284-
->setFirstResult($offset);
285-
$result = $query->execute();
283+
if ($limit > -1) {
284+
$query->setMaxResults($limit);
285+
}
286+
$query->setFirstResult($offset);
287+
$result = $query->executeQuery();
286288

287289
$groups = [];
288290
while ($row = $result->fetch()) {

lib/private/Group/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function createGroup($gid) {
238238
public function search($search, $limit = null, $offset = null) {
239239
$groups = [];
240240
foreach ($this->backends as $backend) {
241-
$groupIds = $backend->getGroups($search, $limit, $offset);
241+
$groupIds = $backend->getGroups($search, $limit ?? -1, $offset ?? 0);
242242
foreach ($groupIds as $groupId) {
243243
$aGroup = $this->get($groupId);
244244
if ($aGroup instanceof IGroup) {

0 commit comments

Comments
 (0)