From b5311badc4ad7ad53bcf97a90ff6af1bf04d844d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 11 Sep 2009 15:53:48 +0000 Subject: [PATCH] * (bug 20556) Stub threshold's "other" in Special:Preferences now has a correct type="text" parameter * 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 | 2 ++ includes/HTMLForm.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7002d903c6..baafaa52f0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -472,6 +472,8 @@ this. Was used when mwEmbed was going to be an extension. * (bug 19531) addPortletLink() now wraps inserted labels in a 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" in Special:Preferences now has a + correct type="text" parameter == API changes in 1.16 == diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index a3b7ca64ee..ca5121e519 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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
\n$textbox"; -- 2.20.1