Skip to content

[stable5.3] fix(api): correct misleading error message on empty keyValuePairs - #3502

Merged
Chartman123 merged 1 commit into
stable5.3from
backport/3500/stable5.3
Jul 16, 2026
Merged

Chartman123 merged 1 commit into
stable5.3from
backport/3500/stable5.3

Conversation

@backportbot

@backportbot backportbot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Backport of PR #3500

updateQuestion() rejected an empty keyValuePairs array with the message
"This form is archived and can not be modified". That message is unrelated
to the actual cause and sends callers looking in the wrong place.

The sibling methods updateForm() and updateOption() already report this
case accurately, and updateQuestion()'s own @throws annotation documents
it as "Empty keyValuePairs, will not update" too, so the string looks like
a copy-paste leftover from the archived-form check further up.

Only the message is changed. The exception type stays OCSBadRequestException
so the HTTP status code is unaffected.

Signed-off-by: Josef Behr <code@josef-behr.de>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@backportbot
backportbot Bot requested a review from Chartman123 July 16, 2026 06:56
@backportbot backportbot Bot added the 3. to review Waiting for reviews label Jul 16, 2026
@Chartman123
Chartman123 enabled auto-merge July 16, 2026 07:02
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Controller/ApiController.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Chartman123
Chartman123 merged commit 2bab8f1 into stable5.3 Jul 16, 2026
51 of 52 checks passed
@Chartman123
Chartman123 deleted the backport/3500/stable5.3 branch July 16, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants