eca_form: Action "Form field: set options" may lead to an illegal choice error

Created on 12 May 2023, over 1 year ago
Updated 15 May 2023, over 1 year ago

Problem/Motivation

The action "Form field: set options" allows to set custom options on any options field, including entity fields.

When the custom options don't include an empty value on their own, but the default value is not specified (i.e. to be empty), then this may lead to an illegal choice error on form submission. Also when resetting one of the first fields to a different value, the form is not capable of resetting the other choices.

Attaching a sample model that has some complex dependencies between fields, that can be changed via Ajax. When selecting a value in "First" field, then an illegal choice error will show up on the "Second" field.

Steps to reproduce

Proposed resolution

When the default value is not specified other than to be empty, then it should be automatically made sure, that the empty option never gets lost.

When the creator of an ECA model does not want an empty option to be available, a default value other than the empty one can still be specified with "Form field: set default value, then the empty value is not needed.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

🇩🇪Germany mxh Offenburg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024