From: Andrew Garrett Date: Fri, 24 Apr 2009 08:58:19 +0000 (+0000) Subject: Update HTMLSelectOrOtherField to correctly work, since the code changes of having... X-Git-Tag: 1.31.0-rc.0~42051 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=de003a1edc59868ea9be8775b589253ebfcf58e5;p=lhc%2Fweb%2Fwiklou.git Update HTMLSelectOrOtherField to correctly work, since the code changes of having "nested" options and swapping keys and values --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 44aec19409..b41dc4bd75 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -591,7 +591,8 @@ class HTMLSelectOrOtherField extends HTMLTextField { $valInSelect = false; if ($value !== false) - $valInSelect = array_key_exists( $value, $this->mParams['options'] ); + $valInSelect = in_array( $value, + HTMLFormField::flattenOptions($this->mParams['options']) ); $selected = $valInSelect ? $value : 'other';