Fix array to string conversion

When we try to use readonly mode for some table, which has relations with other tables (set_relation_n_n() function), we get the error "Array to string conversion". This fix just check, if the $field_values->{$field->field_name} is string or array (object).