jenkins-bot has submitted this change and it was merged.
Change subject: HTMLRadioField: Use another variable for the radio value to
avoid conflicts
......................................................................
HTMLRadioField: Use another variable for the radio value to avoid conflicts
$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
---
M includes/htmlform/HTMLRadioField.php
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Umherirrender: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/htmlform/HTMLRadioField.php
b/includes/htmlform/HTMLRadioField.php
index 19b45be..2d05704 100644
--- a/includes/htmlform/HTMLRadioField.php
+++ b/includes/htmlform/HTMLRadioField.php
@@ -40,9 +40,9 @@
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,
);
}
--
To view, visit https://gerrit.wikimedia.org/r/249409
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I36c760be8ccd86e75249c966f697b499576c83d4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits