The original issue is fixed for upcoming CB 1.2.2.
Here the fix in diff-style:
[code:1]+++ administrator/components/com_comprofiler/comprofiler.class.php
@@ -335,11 +335,11 @@
function selectList( &$arr, $tag_name, $tag_attribs, $key, $text, $selected, $required = 0, $htmlspecialcharText = true ) {
reset( $arr );
$id_name = moscomprofilerHTML::htmlId( $tag_name );
$html = "\n"
. '<select name="' . htmlspecialchars( $tag_name ) . '" id="' . htmlspecialchars( $id_name ) . '" ' . $tag_attribs . '>';
- $addBlank = ( ( ! $required ) && ! ( isset( $arr[0] ) && $arr[0]->$key == '' ) );
+ $addBlank = ( ( ( ! $required ) || ( is_array( $selected ) ? ( count( $selected ) == 0 ) : ( $selected == '' ) ) ) && ! ( isset( $arr[0] ) && $arr[0]->$key == '' ) );
if ( $addBlank ) {
$html .= "\n\t<option value=\"\"> </option>";
}
+++ administrator/components/com_comprofiler/plugin.class.php
@@ -1558,11 +1558,15 @@
$value->text = ( $reason == 'search' ? ( $noneValue ? _UE_NONE : _UE_NO_PREFERENCE ) : _UE_NO_INDICATION );
return $value;
}
function _explodeCBvaluesToObj( $value ) {
if ( ! is_array( $value ) ) {
- $value = explode( '|*|', $value );
+ if ( ( $value === '' ) || is_null( $value ) ) {
+ $value = array();
+ } else {
+ $value = explode( '|*|', $value );
+ }
}
$objArr = array();
foreach( $value as $k => $kv ) {
$objArr[$k]->value = $kv;
$objArr[$k]->text = $kv;
[/code:1]
Edit: (fix format posted is unified diff: remove lines with - and replace by lines with + at begin).
Post edited by: beat, at: 2010/01/05 16:29