Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/Db/SessionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 3 additions & 1 deletion lib/Service/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/PermissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/Service/PermissionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading