Skip to content

fix: adding circles to events (#6023)#8008

Draft
MrAn0nym wants to merge 1 commit intonextcloud:mainfrom
MrAn0nym:patch-2
Draft

fix: adding circles to events (#6023)#8008
MrAn0nym wants to merge 1 commit intonextcloud:mainfrom
MrAn0nym:patch-2

Conversation

@MrAn0nym
Copy link

ContactController::getCircleMembers is used to fetch all members of a circle, when adding that circle to an event.

Currently the function assumes members to be a nextcloud user:

$circleMemberUserId = $circleMember->getUserId();
$user = $this->userManager->get($circleMemberUserId);

This results in empty return values, which in turn causes an error and results in no member of the circle being added

if ($user === null) {
throw new ServiceException('Could not find organizer');
}

The PR changes the code to handle all types separately. Whilst this is not perfect and problems like federation or auto-updating memberlists are not solved by this it at least provides a short term fix for #6023 #6485 and one aspect of nextcloud/circles#1690 if I'm not mistaken.

Signed-off-by: MrAn0nym <63542658+MrAn0nym@users.noreply.github.com>
@MrAn0nym
Copy link
Author

Didn't manage to look into how one would write tests yet and I believe php-cs-fixer will at least replace some quotes as well. If anyone else has the time to fix those last steps feel free to do so, otherwise I'll do so when I get around

@SebastianKrupinski
Copy link
Contributor

Hi @MrAn0nym

Thank you for the PR.

FYI, you might want to wait a couple weeks for this, as there are some pending changes that will be applied to the contacts controller which might effect your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants