From 0f299b93c7a6c0d5a24352e7252ff2c252ef9398 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Fri, 5 Apr 2024 18:30:12 +0200 Subject: [PATCH] extract keys insted of wrong usage of key() Signed-off-by: dartcafe --- CHANGELOG.md | 1 + lib/Model/Group/Group.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ecd2e35..0a37be2fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [7.0.3] - tbd ### Fix - Archive, restore and delete polls in poll list was missing, braught the options back to the action menu + - Fix getting group members ### New - Added an endpoint to the Api to be able to fetch the acl of a poll ## [7.0.2] - 2024-03-29 diff --git a/lib/Model/Group/Group.php b/lib/Model/Group/Group.php index ed2f7c976..cc373012a 100644 --- a/lib/Model/Group/Group.php +++ b/lib/Model/Group/Group.php @@ -49,7 +49,7 @@ class Group extends UserBase { } private function setUp(): void { - $this->group = Container::queryClass(IGroupManager::class)->get($this->id); + $this->group = $this->groupManager->get($this->id); $this->displayName = $this->group->getDisplayName(); } @@ -58,10 +58,10 @@ class Group extends UserBase { */ public function getMembers(): array { $members = []; - $usersInGroup = Container::queryClass(IGroupManager::class)->displayNamesInGroup($this->id); + $usersIdsInGroup = array_keys($this->groupManager->displayNamesInGroup($this->id)); - foreach ($usersInGroup as $user) { - $newMember = new User((string) key($user)); + foreach ($usersIdsInGroup as $userId) { + $newMember = new User($userId); if ($newMember->IsEnabled()) { $members[] = $newMember;