Skip to content

/ocs/v1.php/cloud/groupsUPDATE method - correct status when group not found - #39537

Merged
bigcat88 merged 1 commit into
masterfrom
ocs-update-group
Jul 27, 2023
Merged

/ocs/v1.php/cloud/groupsUPDATE method - correct status when group not found#39537
bigcat88 merged 1 commit into
masterfrom
ocs-update-group

Conversation

@bigcat88

Copy link
Copy Markdown
Member
  • Resolves: did not create one

Summary

We should return OCSController::RESPOND_NOT_FOUND when something from input parameters not found and set text description what exactly was not found.

Checklist

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
@bigcat88bigcat88 changed the title to return correct code when group not found/ocs/v1.php/cloud/groupsUPDATE method - correct status when group not foundJul 22, 2023
@susnux
susnux requested review from a team, ArtificialOwl, icewind1991 and nfebe and removed request for a teamJuly 22, 2023 23:29
@susnuxsusnux added 3. to review Waiting for reviews php Pull requests that update Php code feature: users and groups labels Jul 22, 2023
if ($key === 'displayname') {
$group = $this->groupManager->get($groupId);
if ($group === null) {
throw new OCSException('Group does not exist', OCSController::RESPOND_NOT_FOUND);

@nfebenfebeJul 22, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
thrownewOCSException('Group does not exist', OCSController::RESPOND_NOT_FOUND);
thrownewOCSException("Group $groupIddoes not exist", OCSController::RESPOND_NOT_FOUND);

Is probably more helpful.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the caller already knows what group he requested to edit.

@nfebenfebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good.

@bigcat88
bigcat88 merged commit b93f101 into masterJul 27, 2023
@bigcat88
bigcat88 deleted the ocs-update-group branch July 27, 2023 17:44
@bigcat88

Copy link
Copy Markdown
MemberAuthor

/backport to stable27

@bigcat88

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

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

Labels

3. to reviewWaiting for reviewsfeature: users and groupsphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@bigcat88@marcelklehr@julien-nc@nfebe@susnux