From 6c6efe54ec8c008699b54fe7b46855d0c302bfe6 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 12 Sep 2018 13:14:18 -0700 Subject: [PATCH] HTMLForm: Drop this never-used backwards-compatibility Change-Id: I6864d3a1207de44d465491baad87cb9c00714255 --- RELEASE-NOTES-1.32 | 3 +++ includes/htmlform/fields/HTMLMultiSelectField.php | 3 +-- resources/src/mediawiki.htmlform/multiselect.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 041b3d73db..a42da5da79 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -290,6 +290,9 @@ because of Phabricator reports. Define $wgProfiler via LocalSettings.php instead. * The mw.loader.addSource() is now considered a private method, and no longer supports the `id, url` signature. Use the `Object` parameter instead. +* The backwards-compatibility code in HTMLForm to add a drop-down control to an + option that is not set to be a drop-down if the "mw-chosen" class is present, + is now removed. * Several collations were removed. They were workarounds for bugs in the ICU library and they are no longer needed (as of ICU 57.1): * 'uppercase-se' (NorthernSamiUppercaseCollation) - use 'uca-se' instead diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php b/includes/htmlform/fields/HTMLMultiSelectField.php index 2038606597..e9ecc40f10 100644 --- a/includes/htmlform/fields/HTMLMultiSelectField.php +++ b/includes/htmlform/fields/HTMLMultiSelectField.php @@ -22,8 +22,7 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable $this->mParams['disabled-options'] = []; } - // For backwards compatibility, also handle the old way with 'cssclass' => 'mw-chosen' - if ( isset( $params['dropdown'] ) || strpos( $this->mClass, 'mw-chosen' ) !== false ) { + if ( isset( $params['dropdown'] ) ) { $this->mClass .= ' mw-htmlform-dropdown'; } diff --git a/resources/src/mediawiki.htmlform/multiselect.js b/resources/src/mediawiki.htmlform/multiselect.js index e48376367c..8ef56a22c7 100644 --- a/resources/src/mediawiki.htmlform/multiselect.js +++ b/resources/src/mediawiki.htmlform/multiselect.js @@ -6,7 +6,7 @@ function addMulti( $oldContainer, $container ) { var name = $oldContainer.find( 'input:first-child' ).attr( 'name' ), - oldClass = ( ' ' + $oldContainer.attr( 'class' ) + ' ' ).replace( /(mw-htmlform-field-HTMLMultiSelectField|mw-chosen|mw-htmlform-dropdown)/g, '' ), + oldClass = ( ' ' + $oldContainer.attr( 'class' ) + ' ' ).replace( /(mw-htmlform-field-HTMLMultiSelectField|mw-htmlform-dropdown)/g, '' ), $select = $( '