Index: branches/RC/core/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r10913 -r11178 --- branches/RC/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 10913) +++ branches/RC/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 11178) @@ -165,13 +165,18 @@ $custom_field_helper =& $this->Application->recallObject('InpCustomFieldsHelper'); /* @var $custom_field_helper InpCustomFieldsHelper */ - $options = $custom_field_helper->GetValuesHash( $object->GetDBField('ValueList') ); + $options = $custom_field_helper->GetValuesHash( $object->GetDBField('ValueList'), VALUE_LIST_SEPARATOR, false ); $records = Array (); + + $option_key = key($options); + if ($option_key === '' || $option_key == 0) { + // remove 1st empty option, and add it later, when options will be saved, but allow string option keys + unset($options[$option_key]); // keep index, don't use array_unshift! + } + foreach ($options as $option_key => $option_title) { - if ($option_key > 0) { - $records[] = Array ('OptionKey' => $option_key, 'OptionTitle' => $option_title); - } + $records[] = Array ('OptionKey' => $option_key, 'OptionTitle' => $option_title); } $minput_helper =& $this->Application->recallObject('MInputHelper');