API accepts choice options on a question type that has none
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start at the API route for POST /ocs/v2.php/apps/forms/api/v3/forms/{formId}/questions/{questionId}/options and find the controller method that stores option texts. Read how question types are modelled and where existing type validation for questions happens, then reject option creation when the question type takes no choices. Add or extend the API test covering a short question and confirm it now returns 400 with no rows written.
Written by the indexing model from the issue text.
Description
Describe the bug
The API accepts choice options on a question type that has no choices. They are stored but never used.
Steps to reproduce
- Create a form with a question of type
short(short text). POST /ocs/v2.php/apps/forms/api/v3/forms/{formId}/questions/{questionId}/optionswith{"optionTexts": ["Coffee", "Tea"]}.
Expected behaviour
400: the question type takes no options.
Actual behaviour
- The form still shows a text field, and the two options are stored as dead rows on the question.
Versions
Forms 5.4.2.
- Dominant language
- JavaScript
- Stars
- 385
- Forks
- 133
- Avg merge
- 7h 54m
- Merged PRs (30d)
- 157
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/forms
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
0. Needs triage bug
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
1. to develop enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
nextcloud/forms#3841 · 1 reaction ·
Maintainers usually reply within 1 day
-
0. Needs triage bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
nextcloud/forms#3831 · 1 comment ·
Maintainers usually reply within 1 day
-
1. to develop enhancement
Difficulty 4/5 3-5 days Newbie friendliness 22/100
nextcloud/forms#3829 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cytoscape/cytoscape.js#3597 ·
Maintainers usually reply within 5 days
-
priority: low server testing
Difficulty 1/5 Under an hour Newbie friendliness 88/100
blamechris/chroxy#9277 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
sunososobro-hub/cloudball#191 ·
Maintainers usually reply within 1 day
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/playwright#44289 ·
Maintainers usually reply within 1 day
-
Wire ISO post: has() accepts text values such as an empty string, true or 0x1A for wire numbersOpenarea:post effort:low enhancement P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day