From: kaldari Date: Wed, 22 May 2013 20:15:40 +0000 (-0700) Subject: Removing prefix exception for HTMLCheckMatrix X-Git-Tag: 1.31.0-rc.0~19599^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=commitdiff_plain;h=59b741249e7eeff0831c71565636737cebc31051;p=lhc%2Fweb%2Fwiklou.git Removing prefix exception for HTMLCheckMatrix Unifying how the option prefix is handled for HTMLCheckMatrix and HTMLMultiSelectField. This needs to be deployed at the same time as the dependant Echo extension change Ic8420b89. Change-Id: I4049b666db554283ce953387a30a0a8a7d0cd920 --- diff --git a/includes/Preferences.php b/includes/Preferences.php index d11b2e2667..a6d530f567 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -157,7 +157,7 @@ class Preferences { foreach ( $columns as $column ) { foreach ( $rows as $row ) { - if ( $user->getOption( "$prefix-$column-$row" ) ) { + if ( $user->getOption( "$prefix$column-$row" ) ) { $val[] = "$column-$row"; } } @@ -1571,14 +1571,7 @@ class PreferencesForm extends HTMLForm { foreach ( $this->mFlatFields as $fieldname => $field ) { if ( $field instanceof HTMLNestedFilterable ) { $info = $field->mParams; - 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"; - } + $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname; foreach ( $field->filterDataForSubmit( $data[$fieldname] ) as $key => $value ) { $data["$prefix$key"] = $value; }