Skip to content

API: options created without optionType are stored but not rendered #3505

Closed

Description

@josefbehr

Steps to reproduce

  1. Create a form and a multiple_unique (or dropdown / multiple) question via the API.
  2. Add options without specifying optionType:
POST /ocs/v2.php/apps/forms/api/v3/forms/{formId}/questions/{questionId}/options
Content-Type: application/json

{"optionTexts": ["Yes", "No"]}

Expected behaviour

The options are selectable in the rendered form. optionType is documented as optional, and DataStructure.md states "choice is the default for normal option lists."

Actual behaviour

The options are stored with optionType: null. The API returns them in GET .../forms/{id}, but the frontend does not render them. The question appears with no selectable answers; if it is required, the form cannot be submitted.

The failure is silent: no error, options present in the API response, just not shown.

Root cause

ApiController::newOption() never applies a default optionType. The option_type migration (Version050300Date20250914000000) backfills existing null types to choice, but new inserts through the API keep a null type again.

Server configuration

  • Nextcloud: 32.0.9
  • Forms: 5.3.3

Fix proposed in #3504.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions