adapt $withRelations usage to soko-web 0.7
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good

This commit is contained in:
Bence Pőcze 2023-04-30 20:25:21 +02:00
parent eabf17cb77
commit 49d72f1d48
Signed by: bence
GPG Key ID: DC5BD6E95A333E6D
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class CommunityController implements IAuthenticationRequired
return null; return null;
} }
\Container::$persistentDataManager->loadRelationsFromDb($community, false); \Container::$persistentDataManager->loadRelationsFromDb($community, false, ['main_currency']);
return new HtmlContent('communities/community', [ return new HtmlContent('communities/community', [
'community' => $community, 'community' => $community,
@ -326,7 +326,7 @@ class CommunityController implements IAuthenticationRequired
private function getMembers(Community $community): array private function getMembers(Community $community): array
{ {
$members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true, [User::class])); $members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true, ['user']));
usort($members, function($a, $b) { usort($members, function($a, $b) {
return strnatcmp($a->getUser()->getDisplayName(), $b->getUser()->getDisplayName()); return strnatcmp($a->getUser()->getDisplayName(), $b->getUser()->getDisplayName());
}); });

View File

@ -28,7 +28,7 @@ class HomeController implements IAuthenticationRequired
*/ */
$user = \Container::$request->user(); $user = \Container::$request->user();
$ownCommunityMembers = $this->communityMemberRepository->getAllByUser($user, true, [Community::class]); $ownCommunityMembers = $this->communityMemberRepository->getAllByUser($user, true, ['community']);
$communities = []; $communities = [];
foreach ($ownCommunityMembers as $ownCommunityMember) { foreach ($ownCommunityMembers as $ownCommunityMember) {
$communities[] = $ownCommunityMember->getCommunity(); $communities[] = $ownCommunityMember->getCommunity();