From: Erik Bernhardson Date: Wed, 22 May 2013 16:58:53 +0000 (-0700) Subject: Fix for wrong prefixing of multi checkbox X-Git-Tag: 1.31.0-rc.0~19603^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=47c27494892d78443072b188ca6e8150e39988bf;p=lhc%2Fweb%2Fwiklou.git Fix for wrong prefixing of multi checkbox Bug: 48693 Change-Id: Ifd8d1d54d5252da958c30cdc0ffa1155ba4cf924 --- diff --git a/includes/Preferences.php b/includes/Preferences.php index 1b01750e20..d11b2e2667 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1571,9 +1571,16 @@ class PreferencesForm extends HTMLForm { foreach ( $this->mFlatFields as $fieldname => $field ) { if ( $field instanceof HTMLNestedFilterable ) { $info = $field->mParams; - $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname; + if ( $field instanceof HTMLCheckMatrix ) { + // Echo's use of html check matrix expects the fieldname to be appended with - + // TODO: adjust echo to pass an explicit prefix containing the - and remove + // this misdirection at that time. + $prefix = isset( $info['prefix'] ) ? $info['prefix'] : "$fieldname-"; + } else { + $prefix = isset( $info['prefix'] ) ? $info['prefix'] : "$fieldname"; + } foreach ( $field->filterDataForSubmit( $data[$fieldname] ) as $key => $value ) { - $data["$prefix-$key"] = $value; + $data["$prefix$key"] = $value; } unset( $data[$fieldname] ); }