Don't magically make MediaWiki\Widget classes infusable
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 26 Jul 2016 11:56:47 +0000 (13:56 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 26 Jul 2016 11:56:47 +0000 (13:56 +0200)
For consistency with how normal OOjs UI widgets behave.
Only one usage outside of HTMLForm needed updating. There
are no usages in extensions in Gerrit.

Change-Id: I9b5de86307a13ca7355b7541e8683e4d6a10431f

includes/specials/SpecialSearch.php
includes/widget/ComplexTitleInputWidget.php
includes/widget/SearchInputWidget.php
includes/widget/TitleInputWidget.php
includes/widget/UserInputWidget.php

index aed2fa6..20dbfd1 100644 (file)
@@ -1244,6 +1244,7 @@ class SpecialSearch extends SpecialPage {
                        'autofocus' => trim( $term ) === '',
                        'value' => $term,
                        'dataLocation' => 'content',
+                       'infusable' => true,
                ] );
 
                $layout = new OOUI\ActionFieldLayout( $searchWidget, new OOUI\ButtonInputWidget( [
index ee769da..a9e8042 100644 (file)
@@ -42,9 +42,6 @@ class ComplexTitleInputWidget extends \OOUI\Widget {
                $this->title = new TitleInputWidget( array_merge(
                        $config['title'],
                        [
-                               // The inner TitleInputWidget shouldn't be infusable,
-                               // only the ComplexTitleInputWidget itself can be.
-                               'infusable' => false,
                                'relative' => true,
                                'namespace' => isset( $config['namespace']['value'] ) ?
                                        $config['namespace']['value'] :
index dcd5415..0d71629 100644 (file)
@@ -30,7 +30,6 @@ class SearchInputWidget extends TitleInputWidget {
         */
        public function __construct( array $config = [] ) {
                $config = array_merge( [
-                       'infusable' => true,
                        'maxLength' => null,
                        'type' => 'search',
                        'icon' => 'search',
index 886afa6..da2e94b 100644 (file)
@@ -32,7 +32,7 @@ class TitleInputWidget extends \OOUI\TextInputWidget {
        public function __construct( array $config = [] ) {
                // Parent constructor
                parent::__construct(
-                       array_merge( [ 'infusable' => true, 'maxLength' => 255 ], $config )
+                       array_merge( [ 'maxLength' => 255 ], $config )
                );
 
                // Properties, which are ignored in PHP and just shipped back to JS
index 86c2bc3..d591ad1 100644 (file)
@@ -17,7 +17,7 @@ class UserInputWidget extends \OOUI\TextInputWidget {
         */
        public function __construct( array $config = [] ) {
                // Parent constructor
-               parent::__construct( array_merge( [ 'infusable' => true ], $config ) );
+               parent::__construct( $config );
 
                // Initialization
                $this->addClasses( [ 'mw-widget-userInputWidget' ] );