HTMLForm: Drop this never-used backwards-compatibility
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 12 Sep 2018 20:14:18 +0000 (13:14 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 12 Sep 2018 20:14:18 +0000 (13:14 -0700)
Change-Id: I6864d3a1207de44d465491baad87cb9c00714255

RELEASE-NOTES-1.32
includes/htmlform/fields/HTMLMultiSelectField.php
resources/src/mediawiki.htmlform/multiselect.js

index 041b3d7..a42da5d 100644 (file)
@@ -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
index 2038606..e9ecc40 100644 (file)
@@ -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';
                }
 
index e483763..8ef56a2 100644 (file)
@@ -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 = $( '<select>' ),
                        dataPlaceholder = mw.message( 'htmlform-chosen-placeholder' );
                oldClass = oldClass.trim();