Skip to content
Merged
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
4 changes: 4 additions & 0 deletions lib/Db/RelationalEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public function jsonSerialize() {
return $json;
}

public function __toString(): string {
return (string)$this->getId();
}

/*
* Resolve relational data from external methods
*
Expand Down
10 changes: 1 addition & 9 deletions lib/Service/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,7 @@ public function getUserBoards(int $since = -1, $includeArchived = true): array {
$userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since, $includeArchived);
$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since, $includeArchived);
$circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since, $includeArchived);
$mergedBoards = array_merge($userBoards, $groupBoards, $circleBoards);
$result = [];
/** @var Board $item */
foreach ($mergedBoards as &$item) {
if (!array_key_exists($item->getId(), $result)) {
$result[$item->getId()] = $item;
}
}
return array_values($result);
return array_unique(array_merge($userBoards, $groupBoards, $circleBoards));
}
/**
* @return array
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/OverviewService.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private function findAllBoardsFromUser(string $userId): array {
$userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null);
$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null);
$circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null);
return array_merge($userBoards, $groupBoards, $circleBoards);
return array_unique(array_merge($userBoards, $groupBoards, $circleBoards));
}

private function getBoardPrerequisites($userId): array {
Expand Down