@marios-georgiou,
I'd recommend the following change in the topic custom fields plugin until we release a new version.
Use some plugin which allows editing plugin files or the built-in WordPress plugin file editor, find and open this file: wp-content/plugins/wpforo-topic-custom-fields/wpforotcf.php
Find this code fragment:
private function field_values_to_string($field){
if( $values = wpfval($field, 'values') ){
if( is_array($values) ) {
if( $field['type'] === 'select' ){
$string = '';
foreach( $field['values'] as $k => $v ){
if( is_array($v) ){
$string .= "\n[optgroup=$k]\n" . implode( "\n", $v ) . "\n[/optgroup]";
}else{
$string .= "\n$v";
}
}
$field['values'] = trim($string);
}else{
$field['values'] = implode("\n", $values);
}
}
}
return $field;
}
Replace to this and save:
private function field_values_to_array($field){
if( $values = wpfval($field, 'values') ){
if( is_scalar($values) ) {
$field['values'] = explode( "\n", $values );
if( $field['type'] === 'select' ){
$v = [];
$optgroup = '';
foreach( $field['values'] as $value ){
if( preg_match( '#^ *\[optgroup *= *([^=\]]+?) *] *$#iu', $value, $m ) ){
$optgroup = $m[1];
$v[$optgroup] = [];
}elseif( preg_match( '#^ *\[ */ *optgroup *] *$#iu', $value, $m ) ){
$optgroup = '';
}else{
if( $optgroup ){
$v[$optgroup][] = $value;
}else{
$v[] = $value;
}
}
}
$field['values'] = $v;
}
}
}
return $field;
}