Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8fb27ae

Browse files
committedDec 7, 2011
Define custom field alias using id instead of name
The old method of defining a custom field alias based on the field's name, generated SQL syntax error when trying to sort on that field in the view issues page, if the name contains characters not valid for an SQL identifier (e.g. '-', '(', ')', etc). Fixes #12404, #12680
1 parent 501d30b commit 8fb27ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎core/filter_api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ function filter_get_query_sort_data( &$p_filter, $p_show_sticky, $p_query_clause
917917
$t_custom_field = utf8_substr( $c_sort, utf8_strlen( 'custom_' ) );
918918
$t_custom_field_id = custom_field_get_id_from_name( $t_custom_field );
919919

920-
$c_cf_alias = str_replace( ' ', '_', $t_custom_field );
920+
$c_cf_alias = 'custom_field_' . $t_custom_field_id;
921921
$t_cf_table_alias = $t_custom_field_string_table . '_' . $t_custom_field_id;
922922
$t_cf_select = "$t_cf_table_alias.value $c_cf_alias";
923923

0 commit comments

Comments
 (0)
Please sign in to comment.