Skip to content

Commit

Permalink
Fix filter by custom fields distinct values
Browse files Browse the repository at this point in the history
Fix populating available values for a custom field, to match the
behaviour of version < 2.1, where the retrieved values are those
existing only for current project issues.

Fixes: #23112
  • Loading branch information
cproensa authored and vboctor committed Aug 11, 2017
1 parent 054eee9 commit 508ab61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/filter_form_api.php
Expand Up @@ -1928,7 +1928,8 @@ function print_filter_custom_field( $p_field_id, array $p_filter = null ) {
echo '>[' . lang_get( 'none' ) . ']</option>';
}
# Print possible values
$t_values = custom_field_distinct_values( $t_cfdef );
$t_current_project = helper_get_current_project();
$t_values = custom_field_distinct_values( $t_cfdef, $t_current_project );
if( is_array( $t_values ) ){
$t_max_length = config_get( 'max_dropdown_length' );
foreach( $t_values as $t_val ) {
Expand Down Expand Up @@ -2072,7 +2073,8 @@ function print_filter_custom_field_date( $p_field_id, array $p_filter = null ) {
$p_filter = $g_filter;
}
$t_cfdef = custom_field_get_definition( $p_field_id );
$t_values = custom_field_distinct_values( $t_cfdef );
$t_current_project = helper_get_current_project();
$t_values = custom_field_distinct_values( $t_cfdef, $t_current_project );

# Resort the values so there ordered numerically, they are sorted as strings otherwise which
# may be wrong for dates before early 2001.
Expand Down

0 comments on commit 508ab61

Please sign in to comment.