Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RES-1989 Discourse API for adding group owners has changed #736

Merged
merged 1 commit into from
Nov 18, 2024
Merged
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
6 changes: 3 additions & 3 deletions app/Services/DiscourseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public function syncGroups($idgroups = NULL) {
}
} else if (!$d['owner'] && $shouldBeOwner) {
Log::info("Add $discourseMember as admin of {$discourseId} {$discourseName}");
$response = $client->request('PUT', "/admin/groups/$discourseId/owners.json", [
$response = $client->request('PUT', "/groups/$discourseId/owners.json", [
'form_params' => [
'usernames' => $discourseMember
]
Expand Down Expand Up @@ -465,7 +465,7 @@ public function syncGroups($idgroups = NULL) {
// We add these one by one, rather than in a single call. This is because if our Restarters
// usernames don't match the Discourse ones, e.g. due to anonymisation, then the single
// call would fail.
$response = $client->request('PUT', "/admin/groups/$discourseId/members.json", [
$response = $client->request('PUT', "/groups/$discourseId/members.json", [
'form_params' => [
'usernames' => $restartersMember
]
Expand All @@ -482,7 +482,7 @@ public function syncGroups($idgroups = NULL) {
$this->syncSso($u);

// Now try again to add. If this fails we'll pick it up again next time through.
$response = $client->request('PUT', "/admin/groups/$discourseId/members.json", [
$response = $client->request('PUT', "/groups/$discourseId/members.json", [
'form_params' => [
'usernames' => $restartersMember
]
Expand Down
Loading