$value is used in a foreach loop to build the radioselect fields array for OOUI,
but $value is also the variable, which holds the default value for the element
(or a value, which ws submitted by the user), to pre-select the correct radio input
field. That results in the problem, that $value will always contain the last data,
which passed the foreach loop, and always the last radio input field will be pre-
selected, no matter, what the developer defined as the default or what the user
submitted in a prior form instance.
Change the variable used in the foreach loop to avoid this conflict.
Change-Id: I36c760be8ccd86e75249c966f697b499576c83d4
function getInputOOUI( $value ) {
$options = array();
- foreach ( $this->getOptions() as $label => $value ) {
+ foreach ( $this->getOptions() as $label => $data ) {
$options[] = array(
- 'data' => $value,
+ 'data' => $data,
'label' => $this->mOptionsLabelsNotFromMessage ? new OOUI\HtmlSnippet( $label ) : $label,
);
}