From: Bartosz DziewoƄski Date: Tue, 26 Jul 2016 11:56:47 +0000 (+0200) Subject: Don't magically make MediaWiki\Widget classes infusable X-Git-Tag: 1.31.0-rc.0~6254^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=7c987a0235607012fe90a3bc4f9e859aba9cc30b;p=lhc%2Fweb%2Fwiklou.git Don't magically make MediaWiki\Widget classes infusable 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 --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index aed2fa61e7..20dbfd135a 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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( [ diff --git a/includes/widget/ComplexTitleInputWidget.php b/includes/widget/ComplexTitleInputWidget.php index ee769da1fe..a9e80425e5 100644 --- a/includes/widget/ComplexTitleInputWidget.php +++ b/includes/widget/ComplexTitleInputWidget.php @@ -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'] : diff --git a/includes/widget/SearchInputWidget.php b/includes/widget/SearchInputWidget.php index dcd54154f6..0d7162957e 100644 --- a/includes/widget/SearchInputWidget.php +++ b/includes/widget/SearchInputWidget.php @@ -30,7 +30,6 @@ class SearchInputWidget extends TitleInputWidget { */ public function __construct( array $config = [] ) { $config = array_merge( [ - 'infusable' => true, 'maxLength' => null, 'type' => 'search', 'icon' => 'search', diff --git a/includes/widget/TitleInputWidget.php b/includes/widget/TitleInputWidget.php index 886afa6fee..da2e94bba3 100644 --- a/includes/widget/TitleInputWidget.php +++ b/includes/widget/TitleInputWidget.php @@ -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 diff --git a/includes/widget/UserInputWidget.php b/includes/widget/UserInputWidget.php index 86c2bc3a5b..d591ad1341 100644 --- a/includes/widget/UserInputWidget.php +++ b/includes/widget/UserInputWidget.php @@ -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' ] );