Index: branches/5.1.x/core/units/custom_data/custom_data_event_handler.php =================================================================== diff -u -N -r13313 -r13470 --- branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13313) +++ branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13470) @@ -1,6 +1,6 @@ Application->recallObject('kMultiLanguage'); /* @var $ml_formatter kMultiLanguage */ + $is_install = defined('IS_INSTALL') && IS_INSTALL; + foreach ($custom_fields as $custom_id => $custom_params) { $custom_name = $custom_params['FieldName']; $field_options = Array('type' => 'string', 'not_null' => 1, 'default' => $custom_params['DefaultValue']); @@ -170,7 +172,8 @@ case 'multiselect': case 'radio': if ($custom_params['ValueList']) { - $field_options['options'] = $cf_helper->GetValuesHash($custom_params['ValueList']); + // $is_install check prevents 335 bad phrase sql errors on upgrade to 5.1.0 + $field_options['options'] = $is_install ? Array () : $cf_helper->GetValuesHash($custom_params['ValueList']); $field_options['formatter'] = 'kOptionsFormatter'; $field_options['multiple'] = $custom_params['ElementType'] == 'multiselect'; }