From bbf16f8c3ab661427270580e1bea628cfd25fec8 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sat, 12 Mar 2011 11:08:20 +0000 Subject: [PATCH] Follow-up r83298: keep the two elements of the message separate in an array in HTMLSelectAndOtherField::loadDataFromRequest(), fixes various bugs with validation, defaults, and normalisation. --- includes/HTMLForm.php | 53 +++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index fb78970e04..1010229a10 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1533,8 +1533,7 @@ class HTMLSelectAndOtherField extends HTMLSelectField { } function getInputHTML( $value ) { - - $select = parent::getInputHTML( $value ); + $select = parent::getInputHTML( $value[1] ); $textAttribs = array( 'id' => $this->mID . '-other', @@ -1549,7 +1548,7 @@ class HTMLSelectAndOtherField extends HTMLSelectField { $textbox = Html::input( $this->mName . '-other', - '', + $value[2], 'text', $textAttribs ); @@ -1557,6 +1556,10 @@ class HTMLSelectAndOtherField extends HTMLSelectField { return "$select
\n$textbox"; } + /** + * @param $request WebRequest + * @return Array( ,