* (bug 20556) Stub threshold's "other" <input> in Special:Preferences now has a corre...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 11 Sep 2009 15:53:48 +0000 (15:53 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 11 Sep 2009 15:53:48 +0000 (15:53 +0000)
* also fix a bug in the detection if the "other" value is passed in the predefined options, remember: 0 == 'other' returns true (thank you, PHP, really)

RELEASE-NOTES
includes/HTMLForm.php

index 7002d90..baafaa5 100644 (file)
@@ -472,6 +472,8 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 19531) addPortletLink() now wraps inserted labels in a <span> element to be
   compatible with the CSS for the Vector skin
 * (bug 20578) Wrong localized image metadata - duplicated string?
+* (bug 20556) Stub threshold's "other" <input> in Special:Preferences now has a
+  correct type="text" parameter
 
 == API changes in 1.16 ==
 
index a3b7ca6..ca5121e 100644 (file)
@@ -717,7 +717,7 @@ class HTMLSelectOrOtherField extends HTMLTextField {
        static $jsAdded = false;
 
        function __construct( $params ) {
-               if( !in_array( 'other', $params['options'] ) ) {
+               if( !in_array( 'other', $params['options'], true ) ) {
                        $params['options'][wfMsg( 'htmlform-selectorother-other' )] = 'other';
                }
 
@@ -748,7 +748,7 @@ class HTMLSelectOrOtherField extends HTMLTextField {
 
                $select->setAttribute( 'class', 'mw-htmlform-select-or-other' );
 
-               $tbAttribs = array( 'id' => $this->mID . '-other' );
+               $tbAttribs = array( 'id' => $this->mID . '-other', 'size' => $this->getSize() );
                if( !empty( $this->mParams['disabled'] ) ) {
                        $select->setAttribute( 'disabled', 'disabled' );
                        $tbAttribs['disabled'] = 'disabled';
@@ -761,8 +761,8 @@ class HTMLSelectOrOtherField extends HTMLTextField {
                }
 
                $textbox = Html::input( $this->mName . '-other',
-                                                       $this->getSize(),
-                                                       $valInSelect ? 'text' : $value,
+                                                       $valInSelect ? '' : $value,
+                                                       'text',
                                                        $tbAttribs );
 
                return "$select<br/>\n$textbox";