Skip to content

fix(api): do not change deleted questions - #3910

Merged
Chartman123 merged 1 commit into
mainfrom
fix/api-deleted-question-edits
Nov 18, 2026
Merged

Chartman123 merged 1 commit into
mainfrom
fix/api-deleted-question-edits

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

Follow-up to #3908. Changing a question the owner had deleted, or its options, still worked through the API, although the question no longer shows anywhere. Like reading, copying, reordering and deleting a deleted question already do, these requests now get a Not Found response:

  • PATCH /forms/{id}/questions/{questionId} (update a question)
  • POST /forms/{id}/questions/{questionId}/options (add options)
  • PATCH /forms/{id}/questions/{questionId}/options/{optionId} (update an option)
  • DELETE /forms/{id}/questions/{questionId}/options/{optionId} (delete an option)
  • PATCH /forms/{id}/questions/{questionId}/options (reorder options)

Only users who can edit the form could reach these requests; nothing is restored and respondents are not affected. The docblocks already listed the 404, so openapi.json is unchanged.

Tests

  • New data-provider test in ApiControllerTest for the five endpoints. PHPUnit: 5 more tests than main, no new failures.
  • The full Playwright suite passes on top of this change (55 tests), so the editor is not affected.
  • Checked on a running instance that the editor's delayed saves (title, option text) reach the server before a question's deletion, so deleting a question right after typing shows no error.
  • psalm and php-cs-fixer are clean. The commit applies to stable5.4 without conflicts.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Changing a question the owner had deleted, or its options, still
worked: its text and settings could be updated, and options added,
changed, deleted and reordered, although the question no longer shows
anywhere. These requests now get a Not Found response, like a question
that does not exist, as reading, copying, reordering and deleting a
deleted question already do.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger added this to the 5.5 milestone Nov 18, 2026
@AndyScherzinger AndyScherzinger added bug Something isn't working 3. to review Waiting for reviews AI assisted labels Nov 18, 2026
@AndyScherzinger AndyScherzinger self-assigned this Nov 18, 2026
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable5.4

@backportbot backportbot Bot added the backport-request Pending backport by the backport-bot label Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Chartman123
Chartman123 merged commit a3f3561 into main Nov 18, 2026
51 checks passed
@Chartman123
Chartman123 deleted the fix/api-deleted-question-edits branch November 18, 2026 00:08
@backportbot backportbot Bot removed the backport-request Pending backport by the backport-bot label Nov 18, 2026
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 AI assisted bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants