HTMLRadioField: Do not automatically infuse our RadioSelectInputWidgets
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 16 Nov 2017 16:14:29 +0000 (17:14 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 16 Nov 2017 16:33:03 +0000 (17:33 +0100)
This is really a workaround for an issue in a completely different place:
JS RadioSelectInputWidget internally uses `<input type="hidden">`
rather than real radio buttons, which does not work correctly with the
code in mediawiki.special.preferences.confirmClose.js. Ideally we would
change RadioSelectInputWidget to not do such weird things.

However, I think this is actually a good thing to do in general.
From the user's perspective, PHP RadioSelectInputWidget and JS
RadioSelectInputWidget look and behave the same, so there's no reason
to infuse and rebuild them.

This behavior was implemented in f50cee1375201a5d3fd76c0c262cfc7e66bd5d42
in which unfortunately I did not document the reason for it. For other
fields it makes obvious sense (the JS widgets have improvements like
autocompletion, or at least look "pretty"), but I have no idea why
I did it for this one.

Bug: T180643
Change-Id: I53e50f8cda39466b2396b374e642c154487888bb

includes/htmlform/fields/HTMLRadioField.php

index 77ea7cd..c98e1ec 100644 (file)
@@ -72,10 +72,6 @@ class HTMLRadioField extends HTMLFormField {
                ) );
        }
 
-       protected function shouldInfuseOOUI() {
-               return true;
-       }
-
        public function formatOptions( $options, $value ) {
                global $wgUseMediaWikiUIEverywhere;