Select controls may be defaulted to out-of-range values
Hello, I believe I have found some buggy behaviour in Orbeon. Discovered in 2018.2-ce and confirmed to still affect 2020.1-ce (built from source from their respective branches today).
Select-type questions (radio, checkbox, static dropdown) maybe be defaulted to out-of-range values via trivial itemset manipulations in the UI.
1. Create a new form in the form builder.
2. Create a "Checkboxes", "Radio buttons" or "Static dropdown" field
3. Keep the default itemset (labels: First, Second, Third; values: 1, 2, 3)
4. Make Third (3) the pre-selected value
5. View the form source, note that the control's pre-selected value is shown in fr-form-instance, e.g.
6. Make either of these changes:
a. Remove "Third" from the set of choices.
b. Change the value of "Third" to 4.
7. View the form source again to see that the control-3 initial value did not change.
Expected behaviour: The control's default value is cleared or updated after removing/changing the choice(s) that are part of the initial value.
Actual behaviour: - The control's initial value remains as it was, putting it out-of-range.
- Select1 (radio/dropdown) questions will submit an out-of-range value if the control is not changed to another value before they submit.
- Select (checkbox) questions will always submit the out-of-range value plus whatever set of options were picked; it is seemingly not possible to get rid of the spurious value.