diff --git a/lib/Db/SessionMapper.php b/lib/Db/SessionMapper.php index 186f81929c..15edd12e74 100644 --- a/lib/Db/SessionMapper.php +++ b/lib/Db/SessionMapper.php @@ -45,8 +45,7 @@ public function findAllActive($boardId) { $qb->select('id', 'board_id', 'last_contact', 'user_id', 'token') ->from($this->getTableName()) ->where($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId))) - ->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME))) - ->executeQuery(); + ->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME))); return $this->findEntities($qb); } diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index b88111adde..65096f9832 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -621,7 +621,9 @@ private function enrichBoards(array $boards, bool $fullDetails = true): array { if ($fullDetails) { $this->enrichWithStacks($board); - $this->enrichWithLabels($board); + if ($board->getLabels() === null) { + $this->enrichWithLabels($board); + } $this->enrichWithUsers($board); $this->enrichWithBoardSettings($board); $this->enrichWithActiveSessions($board); diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 27465e351e..2d79fafa30 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -214,7 +214,7 @@ public function findUsers($boardId, $refresh = false) { } try { - $board = $this->boardMapper->find($boardId); + $board = $this->getBoard($boardId); } catch (DoesNotExistException $e) { return []; } catch (MultipleObjectsReturnedException $e) { @@ -227,7 +227,7 @@ public function findUsers($boardId, $refresh = false) { } else { $users[$board->getOwner()] = new User($board->getOwner(), $this->userManager); } - $acls = $this->aclMapper->findAll($boardId); + $acls = $board->getAcl(); /** @var Acl $acl */ foreach ($acls as $acl) { if ($acl->getType() === Acl::PERMISSION_TYPE_USER) { diff --git a/tests/unit/Service/PermissionServiceTest.php b/tests/unit/Service/PermissionServiceTest.php index a25a325d57..70160dc8a2 100644 --- a/tests/unit/Service/PermissionServiceTest.php +++ b/tests/unit/Service/PermissionServiceTest.php @@ -347,9 +347,8 @@ public function testFindUsers() { ->method('__call') ->with('getOwner', []) ->willReturn('user1'); - $this->aclMapper->expects($this->once()) - ->method('findAll') - ->with(123) + $board->expects($this->any()) + ->method('getAcl') ->willReturn([$aclUser, $aclGroup]); $this->boardMapper->expects($this->once()) ->method('find')