AnewtFormControlChoice ensuring selection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Anewt |
In Progress
|
Undecided
|
Sander van Schouwenburg (Sandworm) |
Bug Description
AnewtFormContro
But I think this behavior is fundamentally flawed. It might be a valid choice when in the code you want to make a default choice for the user with $control-
But when the form is seeded by user input this might not be very desirable behavior. There are two cases where I can imagine the value being different from one of the options:
1) A hacker
2) During the time the form is loaded in the browser, someone else changes the options somewhere else, making the user choice invalid.
When dealing with a hacker "any valid choice" is better than "any invalid choice", but in case 2 I'd like the user to get some feedback the option is wrong.
I propose something like a set_default_
tags: | added: form |
Related, since this crash was triggered by ensure_selection()
1485 Wouter Bolsterlee 2009-02-23
[form] Don't crash if no options are set in choice control
The result is that we render nothing useful, but still it's
better than a crash.